[已解决]请教一个技巧,如果已经获得控件的指针,如何把光标移动到控件上?
本帖最后由 sanfer8889 于 2017-8-18 19:06 编辑$control = ControlGetHandle($handle,"","WindowsForms10.EDIT.app.0.5c39d41")$control是一个控件的指针,如果此时,要把光标移动到该控件上,应该如何知道控件的X和Y?
其实如果知道控件的X,Y,我蹩脚的水平还是能写出MouseMove过去的,然后再MouseClick的... 回复 1# sanfer8889
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 437, -1,-1)
$button1 = GUICtrlCreateButton("Test",50,50)
$button2 = GUICtrlCreateButton("move",280,280)
$hbutton2 = GUICtrlGetHandle(-1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $button1
Local $apos = WinGetPos($hbutton2);<=======================这个
MouseMove($apos + 5,$apos + 5)
Sleep(100)
MouseClick("left")
Case $button2
MsgBox(0,"","被自动点击的按钮!")
EndSwitch
WEnd
可以直接
ControlClick
页:
[1]