Hello Me You Posted November 17, 2006 Share Posted November 17, 2006 This is a very basic question, I am sorry, i couldnt find a good example to figure it out for myself. given the code: WinWaitActive("Untitled - Notepad","", 2) I know it tries to activate notepad for 2 seconds. But how do I tell it if successful do this or if it fails then do that? Thanks, and sorry for the stupid question. Random Link to comment Share on other sites More sharing options...
Helge Posted November 17, 2006 Share Posted November 17, 2006 It doesn't try to activate a window, it just waits for the window to become active.So, if you actually want to activate a window then you should try WinActivate instead.Also, to see if something was successful or not, then always look at what's mentionedunder "Return Value" in the helpfile. Link to comment Share on other sites More sharing options...
stampy Posted November 17, 2006 Share Posted November 17, 2006 Check the return value: Return Value Success: Returns 1. Failure: Returns 0 if timeout occurred. $x = WinWaitActive("Untitled - Notepad","", 2) if $x = 1 then ;do this else ;do that endif Link to comment Share on other sites More sharing options...
Hello Me You Posted November 18, 2006 Author Share Posted November 18, 2006 Thank you, that was exactly what I needed. (and much quicker than I would have guessed) Random 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