Jump to content
Sign in to follow this  
greena23

WinWaitActive Questions

Recommended Posts

greena23

Hi,

This may be a very rookie question, but is there any way to have a winwaitactive that only waits for a certain time. Or is there any way to do it that if it doesn't come up we check if something else is up and act on it accordingly. Any help would be great

Share this post


Link to post
Share on other sites
Varian

Helpfile explains this explicitly!!

WinWaitActive ( "title" [, "text" [, timeout]] )

Share this post


Link to post
Share on other sites
Realm

Use Sleep(1000), just change the value to 1000 for every second you need to wait. If you need to run other tasks while waiting, than see Timing functions TimerInit() & TimerDiff().


My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.  

Share this post


Link to post
Share on other sites
greena23

Thanks for the help guys

Just another thing, I'm having a bit of trouble in getting my if to work. I have

If WinWaitActive("","",15) Then

Do Something

EndIF

This will not work for me. Any suggestions

Thanks!

Share this post


Link to post
Share on other sites
Realm

Reading the help file, you will see that WinWaitActive Returns the handle of the window rather than a True statement, however If it happens to timeout, it will return a False statement.

Try this:

If WinWaitActive("","",15)<>0 Then

Edit: Typos

Edited by Realm

My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.  

Share this post


Link to post
Share on other sites
Varian

I am assuming that you are not using a blank Title to check if it is active, because there will (almost) always be some window that is active. Also, it is OK to return the Window Handle because the "If" statement will succeed as long as it DOES NOT return 0, a blank string, or false. Any thing returned other than those 3 values, and the statement is True, even it it returns -1.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.