Bring ALL open Windows Explorer windows to the front

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
stainedpillowcase
Posts: 12
Joined: 23 Jan 2017, 18:50

Bring ALL open Windows Explorer windows to the front

16 May 2017, 18:55

What is my situation:
I've got my windows explorer windows (I always have at least two open, and usually just two) tiled side-by-side on one monitor. They don't overlap. As I work there will be times when

- one or more other windows are in that monitor covering the two explorer windows (but they are not minimised)
- I minimise one or more of the explorer windows
- I press Win+D to show desktop and the explorer windows are hidden (but it looks like via Show Desktop they are not minimised the usual way)

What I want:
I want an AutoHotkey shortcut to bring all my explorer windows to the front from any of the above situations. Not just the last active one, but ALL. If I have Excel maximised on top of the two windows I want the shortcut to bring both explorer windows up over Excel and not just one of them covering half my Excel. I thought of doing a reverse "send to back" on the Excel window to show the explorer windows, but that doesn't work for me because sometimes I have other windows in between my explorer windows and the topmost window.

What I've tried that isn't working for me:
I've tried using ahk_group which is supposed to target all windows in that group, but in execution it still only brings the last active window up. It doesn't even loop the action to work through all windows in the group. Also, WinRestore isn't doing what I want either. When I start up my computer, I first open the explorer windows using Win+E twice, which opens them one on top of the other (*), then I use Win+Left and Win+Right to tile them side by side. WinRestore brings them back to the initial position (*) one of top of the other, so that's kind of useless.

Code: Select all

GroupAdd, Explorer, ahk_class ExploreWClass
GroupAdd, Explorer, ahk_class CabinetWClass

F8::
If WinExist("ahk_group Explorer")
{
	WinRestore, ahk_group Explorer
	WinActivate, ahk_group Explorer
}
else
{
	Run, explorer.exe
}
return
Can someone help me please? Please and thank you in advance!
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Bring ALL open Windows Explorer windows to the front

16 May 2017, 19:16

Try this:

Code: Select all

q:: ;activate Explorer windows
GroupAdd, Explorer, ahk_class ExploreWClass
GroupAdd, Explorer, ahk_class CabinetWClass
WinGet, vWinList, List, ahk_group Explorer
Loop, % vWinList
	WinActivate, % "ahk_id " vWinList%A_Index%
return
Note: GroupActivate/GroupDeactivate may be useful for some situations, but also seem to have similar limitations to the ones you described for this particular situation.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
stainedpillowcase
Posts: 12
Joined: 23 Jan 2017, 18:50

Re: Bring ALL open Windows Explorer windows to the front

16 May 2017, 21:24

Perfect!! That's absolutely what I wanted. Thank you so much!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: arrondark, Black_dog and 100 guests