Skip to content

Instantly share code, notes, and snippets.

@seeker
Created September 30, 2012 09:58
Show Gist options
  • Save seeker/3806373 to your computer and use it in GitHub Desktop.
Save seeker/3806373 to your computer and use it in GitHub Desktop.
Toggle all windows between semi-transparent / opaque
n=0
!+t::
Titles := GetWindows()
if n=0
{
loop, parse, Titles, "`n"
{
if(A_LoopField != "Start" and A_LoopField != "iTunes") ;don't mess up the start button, also iTunes does not like transparency
{
WinSet, Transparent, 222, %A_LoopField%
}
}
n=1
Exit
}
else
{
;WinSet, Transparent, Off, %T%
loop, parse, Titles, "`n"
if(A_LoopField != "Start" and A_LoopField != "iTunes") ;don't mess up the start button, also iTunes does not like transparency
{
WinSet, Transparent, Off, %A_LoopField%
}
}
n=0
Exit
}
GetWindows(){
bl := A_BatchLines
SetBatchLines, -1
WinGet, all, list ;get all hwnd
Loop, %all%
{
WinGetTitle, WTitle, % "ahk_id " all%A_Index%
If WTitle ;Prevent to get blank titles
Output .= WTitle "`n"
}
SetBatchLines, %bl%
Sort, Output, U ;remove duplicates
Return Output
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment