water-tight window activating sequence?

Get help with using AutoHotkey and its commands and hotkeys
Posts: 355
Joined: 28 Nov 2015, 02:45

water-tight window activating sequence?

20 Oct 2016, 05:41

I'd like to make sure that Windows Explorer (or any other program for that matter) is up and running,
before proceeding on to some other jobs.

The following code has some rigorous checking stages that make sure Windows Explorer is active and ready.

Code: Select all

RunWait, Explorer.exe
Sleep 300				; is there an alternative to this?
IfWinExist ahk_class CabinetWClass
        Winactivate ahk_class CabinetWClass
        WinWaitActive ahk_class CabinetWClass
        if ErrorLevel
            MsgBox, WinWait timed out.

        ifWinactive ahk_class CabinetWClass
            msgbox windows explorer is up and ready!
I'd like to know if these intermediary checking steps are sufficient.
Also, is there a way to replace the sleep command? Perhaps with a timed loop?
Any tips & hints are welcome.
Posts: 34
Joined: 11 Aug 2016, 11:31

Re: water-tight window activating sequence?

20 Oct 2016, 05:57

It waits until that program was quit!

Use WinWait instead of Sleep

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], JoeWinograd, manehscripts, mikeyww, nu10e8368NrrfXGQKvwn, ToJaRedi and 76 guests