想实现按CTRL + ALT +1 ~9来抓鼠标的坐标,有没有办法只用一个子程序来实现抓点的功能,而不是现在需要9个子程序
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GUIListView.au3>
#include <EditConstants.au3>
#include <IE.au3>
#include <_ini.au3>
#include <file.au3>
#include <Constants.au3>
#NoTrayIcon
#include <ClipBoard.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 447, 193, 125)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
For $i = 1 To 3
HotKeySet("^!" & $i, "_zhuadian" & $i)
Next
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _zhuadian1()
Opt("MouseCoordMode", 2) ; Caret 坐标模式:1=绝对位置, 0=相对位置, 2=客户区
$pos = MouseGetPos()
ConsoleWrite ("第1个点的坐标为:" & $pos[0] & "," & $pos[1] & @CRLF)
EndFunc ;==>_zhuadian
Func _zhuadian2()
Opt("MouseCoordMode", 2) ; Caret 坐标模式:1=绝对位置, 0=相对位置, 2=客户区
$pos = MouseGetPos()
ConsoleWrite ("第2个点的坐标为:" & $pos[0] & "," & $pos[1] & @CRLF)
EndFunc ;==>_zhuadian
Func _zhuadian3()
Opt("MouseCoordMode", 2) ; Caret 坐标模式:1=绝对位置, 0=相对位置, 2=客户区
$pos = MouseGetPos()
ConsoleWrite ("第3个点的坐标为:" & $pos[0] & "," & $pos[1] & @CRLF)
EndFunc ;==>_zhuadian
|