There you go. Update is how often to double check windows.
If the window title changes it destroys everything and recreates it.
However if the position changes it just scoots it around.
Of course it doesn't care whether the window is minimized or not or if a previous window is entirely covered up.
Didn't add it in because I wasn't sure you wanted it.
Added in option which lets you click through the gui overlays "+E0x20" found that recently. Pretty nice
Code: Select all
#NoEnv
#SingleInstance Force
#NoTrayIcon
update := 500
GroupAdd, Chrome, ahk_class Chrome_WidgetWin_1
Top:
ListWindows =
WinGet, ID, List , ahk_group Chrome
Loop %ID%
{
Max := A_Index
this_id := ID%A_Index%
WinGetTitle, this_title, ahk_id %this_id%
WinGetPos, X, Y,,, ahk_id %this_id%
ListWindows = %ListWindows%%this_title%%A_Tab%%this_id%%A_Tab%%X%%A_Tab%%Y%`n
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+E0x20 option lets you click through the GUI which I like
Gui %A_Index%:+toolwindow -caption +AlwaysOnTop +E0x20
Gui %A_Index%:Font, s20 Verdana
Gui %A_Index%:Add, Text, x5 y5 cRed +BackgroundTrans, %this_title%
Gui %A_Index%:Color, white
Y := Y+150
X := X+500
Gui %A_Index%:Show, x%X% y%Y% NoActivate, Titolo
WinSet, TransColor, white 200, Titolo
}
loop
{
sleep %update%
WinGet, ID, List , ahk_group Chrome
Loop %ID%
newmax := A_Index
If (newmax != Max)
break
reset = 0
;;msgbox, checking windows
Loop, Parse, ListWindows, `n
{
out := A_Loopfield
checkINDEX := A_Index
Loop, parse, out, %A_Tab%
{
If (A_Index = 1)
Title := A_Loopfield
Else If (A_Index = 2)
this_id := A_Loopfield
Else If (A_Index = 3)
X := A_Loopfield
Else If (A_Index = 4)
Y := A_Loopfield
}
WinGetTitle, this_title, ahk_id %this_id%
WinGetPos, newX, newY,,, ahk_id %this_id%
If (this_title != Title)
{
reset = 1
break
}
Else If ((newX != X) || (newY != Y))
{
;;msgbox, moving it
X := newX+500
Y := newY+150
Gui %checkINDEX%:Show, x%X% y%Y% NoActivate, Titolo
}
}
;;msgbox, checked "%checkINDEX%" windows
If (Reset = 1)
break
}
loop, %Max%
Gui %A_Index%:Destroy
;;msgbox, Destroyed going to top...now %newmax% windows
goto Top
Return