Name
SetWindowLongPtr
Synopsis
Modifies the properties of a window:
Declare Function SetWindowLongPtr Lib "user32" Alias "SetWindowLongA" _ (ByVal hwnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long
Parameters
-
hwnd The handle of the window whose attribute is to be modified. You can obtain it by retrieving the value of a form or control’s hWnd property.
-
nIndex A Long indicating the window attribute to be modified. A number of values are possible, though the value used to replace a window procedure is
GWLP_WNDPROC, or -4.-
dwNewLong The replacement value. For a subclassed window, this parameter represents the address of the new window procedure. You can get the address of your new window procedure by passing its name as an argument to the
AddressOfoperator.
Return Value
If successful, the function returns the original value before replacement (in this case, the original address of the window procedure). If it fails, it returns 0.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access