Created
January 18, 2019 09:27
-
-
Save davidrenne/638d10102fc75ac62334dc85301be836 to your computer and use it in GitHub Desktop.
ALT + ` (Switch between same application windows)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!`:: ; Next window | |
WinGetClass, ActiveClass, A | |
WinGet, WinClassCount, Count, ahk_class %ActiveClass% | |
IF WinClassCount = 1 | |
Return | |
Else | |
WinGet, List, List, % "ahk_class " ActiveClass | |
Loop, % List | |
{ | |
index := List - A_Index + 1 | |
WinGet, State, MinMax, % "ahk_id " List%index% | |
if (State <> -1) | |
{ | |
WinID := List%index% | |
break | |
} | |
} | |
WinActivate, % "ahk_id " WinID | |
return | |
!^`:: ; Last window | |
WinGetClass, ActiveClass, A | |
WinGet, WinClassCount, Count, ahk_class %ActiveClass% | |
IF WinClassCount = 1 | |
Return | |
Else | |
WinGet, List, List, % "ahk_class " ActiveClass | |
Loop, % List | |
{ | |
index := List - A_Index + 1 | |
WinGet, State, MinMax, % "ahk_id " List%index% | |
if (State <> -1) | |
{ | |
WinID := List%index% | |
break | |
} | |
} | |
WinActivate, % "ahk_id " WinID | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment