我是个新手,是不是按1检测鼠标在哪个控件上?不知道是不是这样的意思?
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 363, 177, 445, 329)
$Input1 = GUICtrlCreateInput("", 16, 32, 329, 21)
$Input2 = GUICtrlCreateInput("", 16, 64, 329, 21)
$Input3 = GUICtrlCreateInput("", 16, 96, 329, 21)
HotKeySet('1', 'get_info')
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func get_info()
If ControlGetFocus($Form1) = 'Edit1' Then
MsgBox(0, 0, '当前光标选的是第一个控件')
ElseIf ControlGetFocus($Form1) = 'Edit2' Then
MsgBox(0, 0, '当前光标选的是第二个控件')
ElseIf ControlGetFocus($Form1) = 'Edit3' Then
MsgBox(0, 0, '当前光标选的是第三个控件')
EndIf
EndFunc ;==>get_info
|