SetSystemCursor

The SetSystemCursor function enables an application to customize the system cursors. It replaces the contents of the system cursor specified by id with the contents of the cursor specified by hcur, and then destroys hcur.

BOOL SetSystemCursor (
  HCURSOR hcur,  // cursor to be set as a system cursor
  DWORD id       // identifier of the system cursor to replace
);
 

Parameters

hcur
Handle to a cursor. The function replaces the contents of the system cursor specified by id with the contents of the cursor handled by hcur.

The system destroys hcur by calling the DestroyCursor function. Therefore, hcur cannot be a cursor loaded using the LoadCursor function. To specify a cursor loaded from a resource, copy the cursor using the CopyCursor function, then pass the copy to SetSystemCursor.

id
Specifies the system cursor to replace with the contents of hcur.

Following is a list of system cursor identifiers:
Value Description
OCR_APPSTARTING Standard arrow and small hourglass
OCR_NORMAL Standard arrow
OCR_CROSS Crosshair
OCR_HAND Windows NT 5.0 and later: Hand
OCR_HELP Arrow and question mark
OCR_IBEAM I-beam
OCR_NO Slashed circle
OCR_SIZEALL Four-pointed arrow pointing north, south, east, and west
OCR_SIZENESW Double-pointed arrow pointing northeast and southwest
OCR_SIZENS Double-pointed arrow pointing north and south
OCR_SIZENWSE Double-pointed arrow pointing northwest and southeast
OCR_SIZEWE Double-pointed arrow pointing west and east
OCR_UP Vertical arrow
OCR_WAIT Hourglass

Return Values

If the function succeeds, the return value is nonzero.

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

QuickInfo

  Windows NT: Requires version 3.5 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in winuser.h.
  Import Library: Use user32.lib.

See Also

Cursors Overview, Cursor Functions, DestroyCursor, LoadCursor, LoadCursorFromFile, SetCursor