【发布时间】:2018-01-11 07:12:36
【问题描述】:
我尝试运行的 SDK 首先有一个准备安装步骤,然后显示下一步按钮。所以我一直等到看到按钮。
当下一个按钮出现时,ConsolWrite 在循环中写入。但我无法点击按钮。也试过 send("!n") 还是不行。
#include <GUIConstantsEx.au3>
Global $hCtrl = 0, $Waiting = True
$wintitle = "SigCaptureWeb SDK - InstallShield Wizard"
ShellExecute("C:\SigCaptureWeb.exe")
; your GUI loop
While (1)
If $Waiting And WinExists($wintitle) Then
$hCtrl = ControlGetHandle($wintitle, "", "[CLASS:Button; TEXT:&Next >]")
If $hCtrl Then
; we got the handle, so the button is there
; now do whatever you need to do
ConsoleWrite("in the loop")
ControlClick($wintitle,"", "[CLASS:Button; TEXT:&Next >]","{ENTER}")
$Waiting = False
EndIf
EndIf
$iMsg = GUIGetMsg()
Switch $iMsg
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
【问题讨论】:
-
ControlClick控制鼠标,而不是键盘。将"{ENTER}"替换为"primary"或跳过该参数以使用默认"left" -
@Stephan 是我尝试过的东西的遗留物。我之前跳过了,也没有用。
标签: autoit