Can't activate Windows Explorer window

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
john_c
Posts: 493
Joined: 05 May 2017, 13:19

Can't activate Windows Explorer window

17 Feb 2018, 10:42

For some reason, I can't activate Windows Explorer window:

(I.e. default file manager. Not to be confused with Internet Explorer)

Any ideas how to fix it? Thanks.

I tried it on Win7, 32 bit. Probably it will work on newer Windows versions (I don't know).

Code: Select all

#singleInstance, force

f1::
    ; This works:
    ; (Even if multiple Notepad windows are opened)
    ; winActivate, ahk_class Notepad ahk_exe Notepad.exe

    ; This doesn't work:
    ; (Even if only one Explorer window is opened)
    winActivate, ahk_class CabinetWClass ahk_exe explorer.exe
return
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Can't activate Windows Explorer window

17 Feb 2018, 10:54

Perhaps this:

Code: Select all

q:: ;activate Explorer window
if WinExist("ahk_class CabinetWClass") || WinExist("ahk_class ExploreWClass")
	WinActivate
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
john_c
Posts: 493
Joined: 05 May 2017, 13:19

Re: Can't activate Windows Explorer window

17 Feb 2018, 11:00

jeeswg wrote: ...
Thanks, but no, it doesn't work for me. Does it work for you?
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Can't activate Windows Explorer window

17 Feb 2018, 11:25

The usual things would be to: try Window Spy to get identifying information for the window, and consider if the issue is admin windows, and to add MsgBox/SoundBeep to your hotkey subroutine to check that it's working.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Nerafius, RandomBoy and 184 guests