By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

AutoIt MouseGetCursor Function

The AutoIt MouseGetCursor Function is used to return the number of the current cursor.

Edited: 2015-01-15 22:09

The AutoIt MouseGetCursor Function is used to return the current cursor used, the returned value will be a number corresponding to the number of the cursor.

List of Cursors

The below is a list of cursor icons.

0UNKNOWN (Includes pointing and grabbing hand icons)
1APPSTARTING
2ARROW
3CROSS
4HELP
5IBEAM
6ICON
7NO
8SIZE
9SIZEALL
10SIZENESW
11SIZENS
12SIZENWSE
13SIZEWE
14UPARROW
15WAIT
16HAND

AutoIt MouseGetCursor Examples

$CursorID = MouseGetCursor()
MsgBox(4096, "The Number of the Curser is: ", $CursorID)

You can also create aliases for the different numbers returned, this is done by inserting all the cursor names into an array, where each array item has a ID corresponding to the ID of the cursor icons.

$IDs = StringSplit("AppStarting,Arrow,Cross,Help,IBeam,Icon,No,Size,SizeAll,SizeNESW,SizeNS,SizeNWSE,SizeWE,UpArrow,Wait,Hand", ",")
$IDs[0] = "Unknown"

$CursorID = MouseGetCursor()
MsgBox(4096, "Cursor", $IDs[$CursorID])

The StringSplit Function splits a string into an array. In this case we use the comma (,) as split character.