SetClassWord

  WORD SetClassWord(hwnd, nIndex, wNewWord)    
  HWND hwnd; /* handle of window */
  int nIndex; /* index of value to change */
  WORD wNewWord; /* new value */

This function replaces the word specified by the nIndex parameter in the Windows additional class memory defined during class registration for the window specified by the hwnd parameter.

Parameters

hwnd

Identifies the window.

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 four-byte value and so on.

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

Old SetClassWord Index New SetClassLong Index

GCW_CBCLSEXTRA GCL_CBCLSEXTRA
GCW_CBWNDEXTRA GCL_CBWNDEXTRA
GCW_HBRBACKGROUND GCL_HBRBACKGROUND
GCW_HCURSOR GCL_HCURSOR
GCW_HICON GCL_HICON
GCW_HMODULE GCL_HMODULE
GCW_MENUNAME GCL_MENUNAME
GCW_STYLE GCL_STYLE

See Also

GetClassWord, GetClassLong, SetClassLong