Function Reference


MouseGetCursor

Returns the cursor ID Number for the current Mouse Cursor.

MouseGetCursor ( )

Return Value

Returns a cursor ID Number:
    $MCID_UNKNOWN (-1) : (@error can be set if the handle to the cursor cannot be found)
    $MCID_HAND (0)
    $MCID_APPSTARTING (1)
    $MCID_ARROW (2)
    $MCID_CROSS (3)
    $MCID_HELP (4)
    $MCID_IBEAM (5)
    $MCID_ICON (6) (Obsolete for applications marked version 4.0 or later)
    $MCID_NO (7)
    $MCID_SIZE (8) (Obsolete for applications marked version 4.0 or later)
    $MCID_SIZEALL (9)
    $MCID_SIZENESW (10)
    $MCID_SIZENS (11)
    $MCID_SIZENWSE (12)
    MCID_SIZEWE (13)
    $MCID_UPARROW (14)
    $MCID_WAIT (15)
    $MCID_NONE (16)

    Constants are defined in "AutoItConstants.au3".

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