Name
SetClassLongPtr
Synopsis
Replaces the specified member
of
the WNDCLASSEX structure of a window:
Public Declare Function SetClassLongPtr Lib "user32" Alias "SetClassLongA" _ (ByVal hwnd As Long, ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long
Parameters
-
hwnd The handle to a window that was created using the class we want to modify. 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 modify the window procedure is
GCLP_WNDPROC, or -24.-
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
The return value of this function will be the original value in the
class structure that was replaced with the value in the
dwNewLong argument. For our purposes, this
function will return a zero if an error occurred, or the
address of the
original class window procedure if it was successful.
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