Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #InstallKeybdHook
- #SingleInstance force
- /*
- Hotkeys:
- Alt-A: make window always on top
- Alt-W: make window less transparent
- Alt-S: make window more transparent
- Alt-X: make window clickthoughable
- Alt-Z: make window under mouse unclickthroughable
- */
- winArr := Object()
- OnExit, Exit
- !a::
- WinGet, currentWindow, ID, A
- addToWinArr(currentWindow)
- WinGet, ExStyle, ExStyle, ahk_id %currentWindow%
- if (ExStyle & 0x8) ; 0x8 is WS_EX_TOPMOST.
- {
- Winset, AlwaysOnTop, off, ahk_id %currentWindow%
- SplashImage,, x0 y0 b fs12, OFF always on top.
- Sleep, 1500
- SplashImage, Off
- }
- else
- {
- WinSet, AlwaysOnTop, on, ahk_id %currentWindow%
- SplashImage,,x0 y0 b fs12, ON always on top.
- Sleep, 1500
- SplashImage, Off
- }
- return
- !w::
- WinGet, currentWindow, ID, A
- addToWinArr(currentWindow)
- if not (%currentWindow%)
- {
- %currentWindow% := 255
- }
- if (%currentWindow% != 255)
- {
- %currentWindow% += 5
- WinSet, Transparent, % %currentWindow%, ahk_id %currentWindow%
- }
- SplashImage,,w100 x0 y0 b fs12, % %currentWindow%
- SetTimer, TurnOffSI, 1000, On
- Return
- !s::
- SplashImage, Off
- WinGet, currentWindow, ID, A
- addToWinArr(currentWindow)
- if not (%currentWindow%)
- {
- %currentWindow% := 255
- }
- if (%currentWindow% != 5)
- {
- %currentWindow% -= 5
- WinSet, Transparent, % %currentWindow%, ahk_id %currentWindow%
- }
- SplashImage,, w100 x0 y0 b fs12, % %currentWindow%
- SetTimer, TurnOffSI, 1000, On
- Return
- !x::
- WinGet, currentWindow, ID, A
- addToWinArr(currentWindow)
- WinSet, ExStyle, +0x80020, ahk_id %currentWindow%
- return
- !z::
- MouseGetPos,,, MouseWin ; Gets the unique ID of the window under the mouse
- addToWinArr(MouseWin)
- WinSet, ExStyle, -0x80020, ahk_id %currentWindow%
- Return
- TurnOffSI:
- SplashImage, off
- SetTimer, TurnOffSI, 1000, Off
- Return
- addToWinArr(chwnd){
- global winArr
- if (!winArr.hasKey(chwnd))
- winArr[chwnd] := true
- }
- Exit:
- for currentWindow, b in winArr
- {
- WinSet, ExStyle, -0x80020, ahk_id %currentWindow%
- WinSet, Trans, 255, ahk_id %currentWindow%
- Winset, AlwaysOnTop, off, ahk_id %currentWindow%
- }
- ExitApp
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement