Function Reference


MouseGetCursor

Returns the cursor ID Number for the current Mouse Cursor.

MouseGetCursor ( )

Return Value

Returns a cursor ID Number:
-1 = UNKNOWN (@error can be set if the handle to the cursor cannot be found)
0 = HAND
1 = APPSTARTING
2 = ARROW
3 = CROSS
4 = HELP
5 = IBEAM
6 = ICON (Obsolete for applications marked version 4.0 or later)
7 = NO
8 = SIZE (Obsolete for applications marked version 4.0 or later)
9 = SIZEALL
10 = SIZENESW
11 = SIZENS
12 = SIZENWSE
13 = SIZEWE
14 = UPARROW
15 = WAIT

Related

MouseGetPos

Example

#include <MsgBoxConstants.au3>

Sleep(1000) ; Allow time for the cursor to change its state.

; Create an array of possible cursor states using StringSplit.
Local $aArray = StringSplit("Hand|AppStarting|Arrow|Cross|Help|IBeam|Icon (obsolete)|No|" & _
        "Size (obsolete)|SizeAll|SizeNESW|SizeNS|SizeNWSE|SizeWE|UpArrow|Wait|Empty", "|", 2) ; The flag parameter is set to flag = 2 as we don't require the total count of the array.
#cs
    The array returned will contain the following values:
    $aArray[0] = "Hand"
    $aArray[1] = "AppStarting"
    $aArray[2] = "Arrow"
    ...
    $aArray[16] = "Empty"
#ce

Local $iCursor = MouseGetCursor()
MsgBox($MB_SYSTEMMODAL, "CursorID = " & $iCursor, "Which means " & $aArray[$iCursor] & ".") ; Use the CursorID value as the index value of the array