Sign in to follow this  
Followers 0
Tapeworm

need syntax help

5 posts in this topic

Basically what i want to do is to make a exe that waits for "run" or "my computer" window to be active, and then continues. Any one of them could be active, doesnt have to be both (dont think thats even possible anyways).

I would imagine the script to look something like this:

WinWaitActive("Run") or WinWaitActive("My Computer")

the above doesnt work, so does anyone know how to do this in some way?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

does anyone know how to do this in some way?

I believe WinWaitActive() can't be used like that, "winwaitactive() or winwaitactive()". I think the first one is waiting before the latter.

WinWait performs a loop until the window is found.

$found = 0

Do
    If WinExists("Run") or WinExists("My Computer") Then $found = 1
    Sleep(1000)
Until $found = 1

msgbox(0,"","done")
Edited by spudw2k

Share this post


Link to post
Share on other sites

oh so simple! cant believe i didnt think of that :D thanks!!

Share this post


Link to post
Share on other sites

In case you don't know of it, you can use WinActivate() to "activate" (who'da thunk) a window.

Also, keep in mind that "My Computer" will only work when "My Computer" is first opened. Once you navigate to another dir the Window name changes to the path.

Share this post


Link to post
Share on other sites

yeah, i used WinActive() in the script spudw2k posted. So it will standby until it becomes active ^^

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  
Followers 0