; AltTab-replacement for Windows 8:
XButton1 & LButton::
list = ""
WinGet, id, list
Loop, %id%
{
this_ID := id%A_Index%
WinGet, exStyle, exStyle, ahk_id %this_ID%
If !(exStyle & 0x100)
continue
IfWinActive, ahk_id %this_ID%
continue
WinGetTitle, title, ahk_id %this_ID%
If (title = "")
continue
WinActivate, ahk_id %this_ID%
break
}
return
; AltTabMenu-replacement for Windows 8:
XButton1 & RButton::
list = ""
Menu, windows, Add
Menu, windows, deleteAll
WinGet, id, list
Loop, %id%
{
this_ID := id%A_Index%
WinGet, exStyle, exStyle, ahk_id %this_ID%
If !(exStyle & 0x100)
continue
WinGetTitle, title, ahk_id %this_ID%
If (title = "")
continue
WinGetClass, class, ahk_id %this_ID%
If (class = "")
continue
If (class = "ApplicationFrameWindow")
continue
Menu, windows, Add, %title%%A_Tab%ahk_class %class%, ActivateWindow
WinGet, Path, ProcessPath, ahk_id %this_ID%
Menu, windows, Icon, %title%%A_Tab%ahk_class %class%, %Path%,, 0
}
Menu, windows, Show
return
ActivateWindow:
WinActivate, %A_ThisMenuItem%
return
XButton1::Send {XButton1}