AutoIt - ControlClick Flash内容

时间:2014-05-16 19:16:13

标签: flash automation autoit

好的,我正试图在我的工作票务系统上自动关闭多张票,这是基于浏览器并基于闪存构建的(它非常糟糕)。使用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

这是&gt;&gt;&gt;&gt;的输出控制&lt;&lt;&lt;&lt;窗口信息部分:

>>>> 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

非常感谢任何帮助。

---- ---- EDIT

我能提出的最接近类似解决方案的地点是:http://www.autoitscript.com/forum/topic/94736-noob-controlclick/但这似乎并不适合我。再一次,任何帮助都会很有意义。

2 个答案:

答案 0 :(得分:0)

试试这个

ControlClick("[CLASS:MacromediaFlashPlayerActiveX]", "", 172092576, "left", 1, 700, 337)

答案 1 :(得分:0)

Opt("WinTitleMatchMode", 2) ; 2=subStr
$sTitle = "Mozilla"
ControlClick($sTitle, "", "[CLASSNN:MacromediaFlashPlayerActiveX1]", "primary", 1, 700, 337)