Jump to content

WinWaitActive


Kasteel
 Share

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

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