GetWindowWord

2.x

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

The GetWindowWord function retrieves a word value at the specified offset into the extra window memory of the given window. Extra window memory is reserved by specifying a nonzero value in the cbWndExtra member of the WNDCLASS structure used with the RegisterClass function.

Parameters

hwnd

Identifies the window.

nOffset

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

Value Meaning

GWW_HINSTANCE Specifies the instance handle of the module that owns the window.
GWW_HWNDPARENT Specifies the handle of the parent window, if any. The SetParent function changes the parent window of a child window. An application should not call the SetWindowWord function to change the parent of a child window.
GWW_ID Specifies the identifier of the child window.

Return Value

The return value specifies information about the given window if the function is successful.

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 nOffset 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

GetWindowLong, SetParent, SetWindowLong, SetWindowWord