Share via


SetClassLong (Windows CE 5.0)

Send Feedback

This function replaces the specified 32-bit (LONG) value at the specified offset into the extra class memory of the WNDCLASS structure for the class to which the specified window belongs.

DWORDSetClassLong( HWNDhWnd, intnIndex, LONGdwNewLong);

Parameters

  • hWnd
    Handle to the window and, indirectly, the class to which the window belongs.

  • nIndex
    Specifies the 32-bit value to replace. To set a 32-bit value in the extra class memory, specify the positive, zero-based byte offset of the value to be set. Valid values are in the range zero through the number of bytes of extra class memory, minus four; for example, if you specified 12 or more bytes of extra class memory, a value of 8 would be an index to the third 32-bit integer. In Windows CE, the byte offset but must be a multiple of 4 bytes.

    If a mouse cursor is supported, this parameter can be set to the following value.

    Value Description
    GCL_HCURSOR Replaces a handle to the cursor associated with the class.

    Windows CE versions that support mouse cursors include the Iconcurs and Mcursor components rather than the Icon and Cursor components.

  • dwNewLong
    Specifies the replacement value.

Return Values

The previous value of the specified 32-bit integer indicates success. Zero indicates that the value was not previously set or that the function failed. 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.

Unaligned access is not supported.

Use the SetClassLong function with care. For example, it is possible to change the background color for a class by using SetClassLong, but this change does not immediately repaint all windows belonging to the class.

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Winuser.h.

See Also

Window Class Functions | GetClassLong | RegisterClass | SetWindowLong | WindowProc | WNDCLASS

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.