# Function Reference

GUISetCursor

Sets the mouse cursor icon for a GUI window.

GUISetCursor ( [cursorID [, override [, winhandle]]] )

Parameters

cursorID | [optional] Cursor Id (See Remarks).
override | [optional] Force the requested mouse cursor even when over controls (see below). 0 = (default) Don't override a control's default mouse cursor. 1= override control's default mouse cursor.
winhandle | [optional] Windows handle as returned by GUICreate (default is the previously used Window).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

If the cursorID is invalid the standard arrow will be displayed.
Usually when you move the mouse cursor over an edit control or other control the mouse cursor changes shape. The "override" option allows you to force the requested mouse cursor to be shown at all times. Note: If you have changed a controls mouse cursor with GUICtrlSetCursor then this control mouse cursor will always be shown.
For a list of valid cursor IDs see MouseGetCursor.
CursorId = 16 will hide the mouse cursor.

Related

GUICtrlSetCursor

Example

#include <GUIConstants.au3>
$IDC = -1
$newIDC = 0
HotkeySet("{Esc}", "Increment")
GUICreate("Press Esc to Increment", 400, 400,0,0,0x04CF0000, 0x00000110)
GUISetState ()
While GUIGetMsg()<> $GUI_EVENT_CLOSE
If $newIDC <> $IDC Then
$IDC = $newIDC
GUISetCursor($IDC)
EndIf
ToolTip("GUI Cursor #" & $IDC)
WEnd
Exit
Func Increment()
$newIDC = $IDC + 1
If $newIDC > 15 Then $newIDC = 0
EndFunc