SetSystemCursor function (winuser.h)

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(
  [in] HCURSOR hcur,
  [in] DWORD   id
);

Parameters

[in] 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.

[in] 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_NORMAL
32512
Normal select
OCR_IBEAM
32513
Text select
OCR_WAIT
32514
Busy
OCR_CROSS
32515
Precision select
OCR_UP
32516
Alternate select
OCR_SIZENWSE
32642
Diagonal resize 1
OCR_SIZENESW
32643
Diagonal resize 2
OCR_SIZEWE
32644
Horizontal resize
OCR_SIZENS
32645
Vertical resize
OCR_SIZEALL
32646
Move
OCR_NO
32648
Unavailable
OCR_HAND
32649
Link select
OCR_APPSTARTING
32650
Working in background

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

Requirement Value
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