GetClassWord

2.x

  WORD GetClassWord(hwnd, offset)    
  HWND hwnd; /* handle of window, */  
  int offset; /* offset of value to retrieve */

The GetClassWord function retrieves a 16-bit (word) 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.

Parameters

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 two (for example, if 10 or more bytes of extra class memory was specified, a value of 8 would be an index to the fifth 16-bit integer) or one of the following values:

Value Meaning

GCW_CBCLSEXTRA Retrieves the number of bytes of additional class information. For information about how to access this memory, see the following Comments section.
GCW_CBWNDEXTRA Retrieves the number of bytes of additional window information. For information about how to access this memory, see the following Comments section.
GCW_HBRBACKGROUND Retrieves the handle of the background brush.
GCW_HCURSOR Retrieves the handle of the cursor.
GCW_HICON Retrieves the handle of the icon.
GCW_HMODULE Retrieves the handle of the module.
GCW_STYLE Retrieves the window-class style bits.

Return Value

The return value is the 16-bit value in the window's reserved memory, if the function is successful. Otherwise, it is zero, indicating the hwnd or offset parameter is invalid.

Comments

To access any extra two-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 two-byte value in the extra space, 2 for the next two-byte value, and so on.

See Also

GetClassInfo, GetClassLong, GetClassName, RegisterClass, SetClassWord