Function Reference


_WinAPI_SetSystemCursor

Enables an application to customize the system cursors

#include <WinAPIRes.au3>
_WinAPI_SetSystemCursor ( $hCursor, $iID [, $bCopy = False] )

Parameters

$hCursor Handle to a cursor.
$iID This parameter specifies the system cursor to replace with the contents of $hCursor,
and can be one of the following values.
$OCR_NORMAL
$OCR_IBEAM
$OCR_WAIT
$OCR_CROSS
$OCR_UP
$OCR_SIZE
$OCR_ICON
$OCR_SIZENWSE
$OCR_SIZENESW
$OCR_SIZEWE
$OCR_SIZENS
$OCR_SIZEALL
$OCR_ICOCUR
$OCR_NO
$OCR_HAND
$OCR_APPSTARTING
$OCR_HELP
$bCopy [optional] Specifies whether the cursor should be duplicated, valid values:
    True - The cursor is duplicated.
    False - The cursor is not duplicated (Default).

Return Value

Success: True
Failure: False

Remarks

The function replaces the contents of the system cursor specified by ID with the contents of the cursor handled
by $hCursor. The system destroys $hCursor by calling the _WinAPI_DestroyCursor() function. Therefore, $hCursor cannot
be a cursor loaded using the _WinAPI_LoadCursor() function. To specify a cursor loaded from a resource, copy the
cursor using the _WinAPI_CopyCursor() function, then pass the copy to _WinAPI_SetSystemCursor().

Related

_WinAPI_CopyCursor, _WinAPI_DestroyCursor, _WinAPI_LoadCursor

See Also

Search SetSystemCursor in MSDN Library.

Example

#include <WinAPIRes.au3>

Local $hPrev = _WinAPI_CopyCursor(_WinAPI_LoadCursor(0, 32512))

_WinAPI_SetSystemCursor(_WinAPI_LoadCursorFromFile(@ScriptDir & '\Extras\Lens.cur'), 32512)
Sleep(5000)
_WinAPI_SetSystemCursor($hPrev, 32512)