diesel Posted November 11, 2005 Share Posted November 11, 2005 Is there a way to use WinWait to look for more than one window? I have a program that crashes sometimes while doing some processing. The normal behaviour is to wait for the window with the processing completed message. Sometimes the program crashes during this processing step and a different window is displayed. How can I detect the window with the error message if it occurs? I've considered using the timeout option of WinWait to give up after a set time, but I'm wondering if there is another way to do this? Also, the script and program run without having focus or being the active window. I would like to maintain this behaiviour if possible. Thanks, David Link to comment Share on other sites More sharing options...
Shibuya Posted November 11, 2005 Share Posted November 11, 2005 Use If-Else statements? If WinWait("Window1") AND WinWait("Window2") Then ... The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!" Link to comment Share on other sites More sharing options...
MHz Posted November 11, 2005 Share Posted November 11, 2005 I normally think of using Adlib for unexpected events. Or you could use a loop with WinExists. Example of Adlib working. Opt('WinTitleMatchMode', 2) ; Unexpected window Run('explorer ' & @ProgramFilesDir) ; Start Adlib (using very large time just for example) AdlibEnable('AdlibFunction', 10000) MsgBox(4096, '', 'WinWait is following this message in 2 second', 2) ; Waiting for this window WinWait('NoWindow') AdlibDisable() Func AdlibFunction() If WinExists('Program Files') Then MsgBox(4096, 'Unexpected window found', 'Closing Unexpected "Program Files" window', 2) WinClose('Program Files') Exit EndIf EndFunc Link to comment Share on other sites More sharing options...
diesel Posted November 11, 2005 Author Share Posted November 11, 2005 I normally think of using Adlib for unexpected events. Or you could use a loop with WinExists.Thanks MHz! AdlibEnable is going to do the trick for me.Shibuya: I tried using an if-else structure as well as an if statement with an OR condition. Only the first condition seems to be recognized in both cases. Thanks for your suggestion.David Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now