This topic has not yet been rated - Rate this topic

SetClassWord function

Applies to: desktop apps only

Replaces the 16-bit (WORD) value at the specified offset into the extra class memory for the window class to which the specified window belongs.

Note  This function is provided only for compatibility with 16-bit versions of Windows. Applications should use the SetClassLong function.

Syntax

WORD WINAPI SetClassWord(
  __in  HWND hWnd,
  __in  int nIndex,
  __in  WORD wNewWord
);

Parameters

hWnd [in]

Type: HWND

A handle to the window and, indirectly, the class to which the window belongs.

nIndex [in]

Type: int

The zero-based byte offset of the value to be replaced. Valid values are in the range zero through the number of bytes of class memory minus two; for example, if you specified 10 or more bytes of extra class memory, a value of 8 would be an index to the fifth 16-bit integer.

wNewWord [in]

Type: WORD

The replacement value.

Return value

Type:

Type: WORD

If the function succeeds, the return value is the previous value of the specified 16-bit integer. If the value was not previously set, the return value is zero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

Reserve extra class memory by specifying a nonzero value in the cbClsExtra member of the WNDCLASS structure used with the RegisterClass function.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Reference
GetClassWord
RegisterClass
SetClassLong
WNDCLASS
Conceptual
Window Classes

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ