Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Uncomment this if you want a hotkey to set it for every
- ; !+r::GoSub, AdjustAllWindows
- ; Initalise the hook
- GoSub, HookWindow
- ; Run it once for every window
- GoSub, AdjustAllWindows
- Return
- HookWindow:
- ; New Window Hook
- Gui +LastFound
- hWnd := WinExist()
- DllCall( "RegisterShellHookWindow", UInt,hWnd )
- MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
- OnMessage( MsgNum, "ShellMessage" )
- ShellMessage(wParam,lParam) {
- If (wParam = 1) ; HSHELL_WINDOWCREATED := 1
- {
- Sleep, 10
- AdjustWindow(lParam)
- }
- }
- Return
- ; Adjust Window
- AdjustWindow(id)
- {
- WinId := id
- WinTitle := id = "A" ? "A" : "ahk_id " . id
- WinGet, WinProcess, ProcessName, %WinTitle%
- ; Exclude Firefox
- ToolTip, % WinProcess
- If (WinProcess <> "firefox.exe")
- {
- WinSet, Style, -0xC00000, %WinTitle%
- }
- ListLines
- Pause
- }
- AdjustAllWindows:
- WinGet, id, list,,, Program Manager
- Loop, %id%
- {
- AdjustWindow(id%A_Index%)
- }
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement