SetSystemCursor function

Enables an application to customize the system cursors. It replaces the contents of the system cursor specified by the id parameter with the contents of the cursor specified by the hcur parameter and then destroys hcur.

Syntax

BOOL SetSystemCursor(
  HCURSOR hcur,
  DWORD   id
);

Parameters

hcur

Type: HCURSOR

A handle to the 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

Type: DWORD

The system cursor to replace with the contents of hcur. This parameter can be one of the following values.

Value Meaning
OCR_APPSTARTING
32650
Standard arrow and small hourglass
OCR_NORMAL
32512
Standard arrow
OCR_CROSS
32515
Crosshair
OCR_HAND
32649
Hand
OCR_HELP
32651
Arrow and question mark
OCR_IBEAM
32513
I-beam
OCR_NO
32648
Slashed circle
OCR_SIZEALL
32646
Four-pointed arrow pointing north, south, east, and west
OCR_SIZENESW
32643
Double-pointed arrow pointing northeast and southwest
OCR_SIZENS
32645
Double-pointed arrow pointing north and south
OCR_SIZENWSE
32642
Double-pointed arrow pointing northwest and southeast
OCR_SIZEWE
32644
Double-pointed arrow pointing west and east
OCR_UP
32516
Vertical arrow
OCR_WAIT
32514
Hourglass

Return Value

Type: BOOL

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.

Remarks

For an application to use any of the OCR_ constants, the constant OEMRESOURCE must be defined before the Windows.h header file is included.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

Conceptual

Cursors

DestroyCursor

LoadCursor

LoadCursorFromFile

Reference

SetCursor