Jump to content

Recommended Posts

Posted

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?

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
Posted

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.

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
×
×
  • Create New...