Jump to content

WinWaitActive Questions


Recommended Posts

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

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...