3

我正在使用 AutoIt 来自动化安装程序,我开始使用Run().

最初,安装程序的Next按钮被禁用(此时其类为Button3)。启用按钮后,Next其类更改为Button1。我不确定如何定位此按钮:

WinWait("AirWatch - Installation Wizard", "")
If Not WinActive("AirWatch - Installation Wizard", "") Then WinActivate("AirWatch - Installation Wizard", "")
WinWaitActive("AirWatch - Installation Wizard", "")
While Not ControlCommand('AirWatch - Installation Wizard', '', 'Button3', 'IsEnabled', '')
    Sleep(500)
WEnd
ControlClick('AirWatch - Installation Wizard', '&Next >', '[ID:17696]')
;Note: Text: &Next >
If Not ControlCommand('AirWatch - Installation Wizard', '', 'Button1', 'IsEnabled', '') Then
    Do
        Sleep(10)
    Until ControlCommand('AirWatch - Installation Wizard', '', 'Button1', 'IsEnabled', '')
EndIf
4

1 回答 1

0

模拟单击 Windows 开始栏。这应该刷新窗口,然后它应该有ControlID按钮的原件。这似乎很骇人听闻。

编码 :

WinActivate($WinName, "")
WinWaitActive($WinName, "")
$winPos = WinGetPos($WinName, "")
;  $winPos-Array contains x/y-coords. The click will be at the mainbar for most windows
;  and will be instant (invoked by the last parameter being 0)
MouseClick("primary", $winPos[0] + 150, $winPos[1] + 10, 1, 0)
; .... 
; ... Do your stuff
于 2013-09-08T20:48:35.570 回答