好的,我试图在我的工作票务系统上自动关闭多个门票,这是基于浏览器和构建在flash(这是残暴的)。使用AutoIt v3窗口信息,我能够获得大部分信息,但点击没有记录。我知道窗口必须是活动的ControlClick工作,但没有任何进展。
代码:
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $AutoClose
$NumTickets = GUICtrlRead($NumTicketsBox)
$iState = 1
$i = 0
Case Else
If $iState = 1 Then
If $i >= $NumTickets Then
$iState = 3
ContinueLoop
EndIf
ControlClick("[CLASS:MacromediaFlashPlayerActiveX]", "", "", "left", 1, 143, 474)
$iState = 2
$iTimer = TimerInit()
ElseIf $iState = 2 Then
If TimerDiff($iTimer) < 2000 Then ContinueLoop
ControlClick("[CLASS:MacromediaFlashPlayerActiveX]", "", "", "left", 1, 700, 337)
$iTimer = TimerInit()
$i = $i + 1
$iState = 1
ElseIf $iState = 3 Then
If TimerDiff($iTimer) < 1000 Then ContinueLoop
If $i <= 0 Then
$iState = 1
ContinueLoop
EndIf
ControlClick("[CLASS:MacromediaFlashPlayerActiveX]", "", "", "left", 1, 59, 337)
$iTimer = TimerInit()
$i = $i - 1
EndIf
EndSelect
WEnd
这是>>>>控件<<<<窗口信息:
>>>> Control <<<<
Class: MacromediaFlashPlayerActiveX
Instance: 1
ClassnameNN: MacromediaFlashPlayerActiveX1
Name:
Advanced (Class): [CLASS:MacromediaFlashPlayerActiveX; INSTANCE:1]
ID: 172092576
Text:
Position: 8, 194
Size: 760, 620
ControlClick Coords: 59, 339
Style: 0x56000000
ExStyle: 0x00000000
Handle: 0x0002117A
任何帮助都将是非常感激的。
——编辑——
最接近的事情我可以想出一个类似的解决方案位于这里:http://www.autoitscript.com/forum/topic/94736-noob-controlclick/但这似乎不适合我。再次感谢您的帮助。
试试这个
ControlClick("[CLASS:MacromediaFlashPlayerActiveX]", "", 172092576, "left", 1, 700, 337)
Opt("WinTitleMatchMode", 2) ; 2=subStr
$sTitle = "Mozilla"
ControlClick($sTitle, "", "[CLASSNN:MacromediaFlashPlayerActiveX1]", "primary", 1, 700, 337)