Zoar Posted July 21, 2010 Share Posted July 21, 2010 Hi, Very new to this so sorry if this is a little stupid. Just starting a script to open my web browser and am using “winwaitactive” with a timeout value which I understand. However how do I capture the “Return Value” which according to the help is “0” if the timeout fails, so I can redirect the script? WinWaitActive ( "title" [, "text" [, timeout]] ) Parameters title The title of the window to check. See Title special definition. text [optional] The text of the window to check. timeout [optional] Timeout in seconds Return Value Success: Returns handle to the requested window. Failure: Returns 0 if timeout occurred. Link to comment Share on other sites More sharing options...
JohnOne Posted July 21, 2010 Share Posted July 21, 2010 $returnvalue = WinWaitActive ( "title", "text", 5) $returnvalue now holds the return value from WinWaitActive If the window does not become active within 5 seconds the value will be 0 Else it will be a handle to that window. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Zoar Posted July 21, 2010 Author Share Posted July 21, 2010 Ah so simple, like me! Thanks for the very quick reply Link to comment Share on other sites More sharing options...
adik2dmax666 Posted July 21, 2010 Share Posted July 21, 2010 or.. Global $Filler = WinExists("Google - Mozilla Firefox", "") If $Filler = 1 Then MsgBox(0,"Testing","Firefox exists, return value: " & $Filler) Elseif $Filler = 0 Then MsgBox(0,"Testing","Firefox inexistent, return value: " & $Filler) EndIf First learn computer science and all the theory. Next develop a programming style. Then forget all that and just hack. -George Carrette[sub]GD Keylogger Creator (never released)[/sub][sub]Garena Autojoin v3.0[/sub] 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