MouseGetCursor
返回当前鼠标光标的 ID.
MouseGetCursor ( )
返回值
返回光标的 ID:
-1 = UNKNOWN (如果没有找到鼠标句柄会设置 @error)
0 = HAND(手型)
1 = APPSTARTING(后台运行)
2 = ARROW(正常选择)
3 = CROSS(十字光标)
4 = HELP(帮助)
5 = IBEAM(选定文本)
6 = ICON (图标 - 4.0 或之后版本不再可用)
7 = NO(不可用)
8 = SIZE (设置大小 - 4.0 或之后版本不再可用)
9 = SIZEALL(移动)
10 = SIZENESW(左下-右上沿对角线调整)
11 = SIZENS(垂直调整)
12 = SIZENWSE(左上-右下沿对角线调整)
13 = SIZEWE(水平调整)
14 = UPARROW(候选)
15 = WAIT(忙碌)
函数示例
#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
----------------------------------------
该函数可以通过命令调用 exect
参见:
MouseGetPos
exect=$var_i=MouseGetCursor()||_ViewValues($var_i) ;; 获取鼠标光标显示状态的ID
© Аверин Андрей для Total Commander Image Averin-And@yandex.ru
|