Guest Greg Thomas Posted July 5, 2004 Posted July 5, 2004 I've a VB program using the ActiveX DLL. After clicking on a button, depending on something outside of my control, one of three windows will (eventually) appear. Is there an easy way to wait for one of the three to arrive? At the moment, I've got something like Do If autoIt.WinWait("Window 1", "", 1) = 1 Then WinFound = 1 ElseIf autoIt.WinWait("Window 2", "", 1) = 1 Then WinFound = 2 ElseIf autoIt.WinWait("Window 3", "", 1) = 1 Then WinFound = 3 End If Loop While WinFound = 0This works, but it does mean that there is a few seconds delay, depending on where in the loop you are, before the program continues. Of course, the more windows you are looking for, the worse the delay is! I suppose I could use WinExists() to get an instant result, with a Sleep() to stop the loop from burning CPU, but there is still a delay in waiting for the Sleep() to finish. I wonder if anyone can think of a better way of doing it? I guess what I really want is WinWaitOr(), which takes an array of window titles/texts. returning the index of the array of the window it found. Thanks, Greg
Administrators Jon Posted July 5, 2004 Administrators Posted July 5, 2004 I'd use the WinExists method with a tiny sleep on each loop (sleep 10 is a good value to use). Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
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