Created
September 30, 2012 09:58
-
-
Save seeker/3806373 to your computer and use it in GitHub Desktop.
Toggle all windows between semi-transparent / opaque
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
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