Jump to content

Recommended Posts

Posted

Hi,

Can I use WinWaitActive for two possible windows? I'm writing a script for my CAD software. After I pause the script for input either the "[Title:Editing Composite; Class:#32770]" window is going to appear or the "[Title:Solid; Class:#32770]" window is going to appear.

How can I tell WinWaitActive to wait for a window where there are two possibilities?

Thanks,

Garret

Posted

You can't check two at once, but a simple loop can do it for you:

$iTimeout = TimerInit()
While 1
    If TimerDiff($iTimeout) >= 30000 Then
        MsgBox(16, "Error", "30sec timeout before either window came up!")
        Exit
    ElseIf WinExists("[Title:Editing Composite; Class:#32770]", "") Then  
        ; Hanle it
        ExitLoop
    ElseIf WinExists("[Title:Solid; Class:#32770]") Then
        ; Handle it
        ExitLoop
    EndIf
    Sleep(100)
WEnd

:graduated:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted

  Quote

WinActive

--------------------------------------------------------------------------------

Checks to see if a specified window exists and is currently active.

WinActive ( "title" [, "text"] )

Parameters

title The title of the window to check. See Title special definition.

text [optional] The text of the window to check.

WinActive ( "[REGEXPTITLE:.*(Mozilla|Internet Explorer).*]" )

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...