SetWindowWord

  WORD SetWindowWord(hwnd, nIndex, wNewWord)    
  HWND hwnd; /* handle of window */
  int nIndex; /* offset of value to set */
  WORD wNewWord; /* new value */

This function changes an attribute of the window specified by the hwnd parameter.

Parameters

hwnd

Identifies the window to be modified.

nIndex

Specifies the byte offset of the word to be changed.

wNewWord

Specifies the replacement value.

Return Value

The return value specifies the previous value of the specified word.

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 nIndex parameter, starting at zero for the first two-byte value in the extra space, two for the next two-byte value and so on.

Use the SetWindowLong function to set the following system-defined values:

Old SetWindowWord Index New SetWindowLong Index

GWW_HINSTANCE GWL_HINSTANCE
GWW_HWNDPARENT GWL_HWNDPARENT
GWW_ID GWL_ID

See Also

GetParent, GetWindowLong, GetWindowWord, SetParent, SetWindowLong