Jump to content
Sign in to follow this  
Kasteel

WinWaitActive

Recommended Posts

Kasteel

Hi

I am using WinWaitActive to wait for a screen to come up before I continue. The problem is that the screen header will sometimes say "Test1" and other times it would say "Test2". Is it possible to specify 2 dailog text strings for it to wait for?

Example: WinWaitActive("Test1") OR WinWaitActive("Test2")

Any help would be appreciated.

Thanks

Share this post


Link to post
Share on other sites
jebus495

Hi

I am using WinWaitActive to wait for a screen to come up before I continue. The problem is that the screen header will sometimes say "Test1" and other times it would say "Test2". Is it possible to specify 2 dailog text strings for it to wait for?

Example: WinWaitActive("Test1") OR WinWaitActive("Test2")

Any help would be appreciated.

Thanks

WinWaitActive("Test")

???

See "Window Titles and Text (Advanced)" in the help file for more information.

Edited by jebus495

Share this post


Link to post
Share on other sites
Kasteel

WinWaitActive("Test")

???

See "Window Titles and Text (Advanced)" in the help file for more information.

I tried that but had no luck.

Share this post


Link to post
Share on other sites
jebus495

I tried that but had no luck.

Try

Opt("WinTitleMatchMode", 2)

And if even that fails...

NVM

Didn't work lol...

Edit:

Do
$test1 = WinWaitActive("Test1", "", 1)
$test2 = WinWaitActive("Test2", "", 1)
Until $test1 Or $test2 = 1

If that doesn't work then IDK what to tell you.

Edited by jebus495

Share this post


Link to post
Share on other sites
Kasteel

Try

Opt("WinTitleMatchMode", 2)

And if even that fails...

Thanks :)

NVM

Didn't work lol...

Edit:

Do
$test1 = WinWaitActive("Test1", "", 1)
$test2 = WinWaitActive("Test2", "", 1)
Until $test1 Or $test2 = 1

If that doesn't work then IDK what to tell you.

Share this post


Link to post
Share on other sites
omikron48

Opt("WinTitleMatchMode", 2)

That will let you succeed on a partial match with any title text. In your case, in conjunction with that Opt, you would use this towait for any of your two windows:

WinWaitActive("Test")

That works since "Test" has a partial match to both "Test1" and "Test2". Actually, now that I think of it, you don't even need use the Opt since window title matching is done from left to right by default to "Test" will match both "Test1" and "Test2". You only need to set that Opt if your partial string is located somewhere else in your title text.

If, however, you want to wait for more than one window and their title texts differ greatly, then you have to code it manually.

While NOT WinActive($title1) OR NOT WinActive($title2)
    Sleep(100)
WEnd
Edited by omikron48

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×