Skip to content

Instantly share code, notes, and snippets.

@davidrenne
Created January 18, 2019 09:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidrenne/638d10102fc75ac62334dc85301be836 to your computer and use it in GitHub Desktop.
Save davidrenne/638d10102fc75ac62334dc85301be836 to your computer and use it in GitHub Desktop.
ALT + ` (Switch between same application windows)
!`:: ; 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