LONG GetClassLong(hwnd, offset) | |||||
HWND hwnd; | /* handle of window, */ | ||||
int offset; | /* offset of value to retrieve | */ |
The GetClassLong function retrieves a 32-bit (long) value at the specified offset into the extra class memory for the window class to which the given window belongs. Extra class memory is reserved by specifying a nonzero value in the cbClsExtra member of the WNDCLASS structure used with the RegisterClass function.
hwnd
Identifies the window.
offset
Specifies the zero-based byte offset of the value to be retrieved. Valid values are in the range zero through the number of bytes of class memory minus four (for example, if 12 or more bytes of extra class memory was specified, a value of 8 would be an index to the third 32-bit integer) or one of the following values:
Value | Meaning |
GCL_MENUNAME | Retrieves a 32-bit pointer to the menu-name string. |
GCL_WNDPROC | Retrieves a 32-bit pointer to the window procedure. |
The return value is the specified 32-bit value in the extra class memory if the function is successful. Otherwise, it is zero, indicating the hwnd or offset parameter is invalid.
To access any extra four-byte values allocated when the window-class structure was created, use a positive byte offset as the index specified by the offset parameter, starting at 0 for the first four-byte value in the extra space, 4 for the next four-byte value, and so on.
GetClassInfo, GetClassName, GetClassWord, RegisterClass, SetClassLong