water-tight window activating sequence?

Get help with using AutoHotkey and its commands and hotkeys
paik1002
Posts: 352
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

#e::
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.
            return
        }        

        ifWinactive ahk_class CabinetWClass
        {
            msgbox windows explorer is up and ready!
        }
        return
}
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.
drawback
Posts: 34
Joined: 11 Aug 2016, 11:31

Re: water-tight window activating sequence?

20 Oct 2016, 05:57

RunWait?
It waits until that program was quit!

Use WinWait instead of Sleep

Return to “Ask For Help”

Who is online

Users browsing this forum: A_Birdi, flyingDman, niky45, scriptor2016 and 59 guests