Jump to content
Sign in to follow this  
Zoar

Return Values?

Recommended Posts

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.

Share this post


Link to post
Share on other sites

$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.

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...