Function Reference


Enables an application to customize the system cursors

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


$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.
$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


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().


_WinAPI_CopyCursor, _WinAPI_DestroyCursor, _WinAPI_LoadCursor

See Also

Search SetSystemCursor in MSDN Library.


#include <WinAPIRes.au3>

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

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