求助: 请问为什么controlclick不能根据文本点击?
Local $e = WinGetHandle ("", "");MsgBox($MB_SYSTEMMODAL, "", $e)
Local $button = ControlGetHandle ($e, "", "")
;MsgBox($MB_SYSTEMMODAL, "", $button)
ControlClick ("Confirm Uninstall", "", "")
应该是可以的,你看看是否可以获取控件的句柄 能获取控件句柄,不知道是不是窗口没被激活?
如果改成Cancel, 运行后cancel button并不会被选中
ControlClick ($e, "Confirm Uninstall","") Local $e = WinGetHandle ("", "")
Local $button = ControlGetHandle ($e, "", "")
MsgBox($MB_SYSTEMMODAL, "", $button)
Local $position = ControlGetPos($button, "", "")
MsgBox($MB_SYSTEMMODAL, "", "Position: " &$position & ", " &$position & @CRLF & "Size: " &$position & ", " & $position)
Local $move =ControlMove($e, "OK", "", "$position", "$position", "$position", "$position")
MsgBox($MB_SYSTEMMODAL, "", $move)
Send ("!a")
使光标移到button上面直接关闭也不行,请问这到底什么原因? 有窗口,有控件,应该能控制吧。似乎是你函数参数没用对?比如
Local $position = ControlGetPos($button, "", "这里应该有控件才对吧?") 如一楼所说点击OK
这样应该就行了,我都是这么用的。ControlClick ("Confirm Uninstall", "", "Button1") 回复 5# fybhwsx
Local $e = WinGetHandle ("")
;MsgBox($MB_SYSTEMMODAL, "", $e)
WinWait("","",10)
If WinExists("Confirm Uninstall", "OK") Then
MsgBox($MB_SYSTEMMODAL, "", "Window exists")
Else
MsgBox($MB_SYSTEMMODAL, "", "Window does not exist")
EndIf
Local $button = ControlGetHandle ($e, "OK", "")
MsgBox($MB_SYSTEMMODAL, "", $button)
Local $position = ControlGetPos($e, "OK", "")
MsgBox($MB_SYSTEMMODAL, "", "Position: " &$position & ", " &$position & @CRLF & "Size: " &$position & ", " & $position)
Local $R = ControlClick ("Confirm Uninstall", "OK", "", "left", 2, $position-60, 10)
MsgBox($MB_SYSTEMMODAL, "", $R)
controlclick返回值也是1, 请教一下,怎么知道click在哪里呢?感谢 学习 学习正好遇到此类问题
页:
[1]