From 3222073596b250410e557807404d188ae355e945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 24 Aug 2021 23:28:46 +0200 Subject: windows: Add hotkeys to raise and hide application windows --- tt.windows.ahk | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tt.windows.ahk b/tt.windows.ahk index e6b93f5..26748a0 100644 --- a/tt.windows.ahk +++ b/tt.windows.ahk @@ -12,7 +12,44 @@ Gui, FakeWindow:Show, x0 y%y% AutoSize NA, FakeWindow ;; -> body +; Raise all windows of the same process +LWin Up:: +Loop, 2 +{ + hwnd := WinActive("A") + WinGet, exe, ProcessName, A + WinGet, L, List, ahk_exe %exe% + Loop, % L + { + DllCall("SetWindowPos" + , "UInt", L%A_Index%, "UInt", hwnd + , "Int", 0, "Int", 0, "Int", 0, "Int", 0 + , "UInt", 0x0001|0x0002|0x4000) ; SWP_NOSIZE|SWP_NOMOVE|SWP_ASYNCWINDOWPOS + } +} +return + +; Hide all windows of the same process (except the current one) ++LWin Up:: +Loop, 2 +{ + hwnd := WinActive("A") + WinGet, exe, ProcessName, A + WinGet, L, List, ahk_exe %exe% + Loop, % L + { + if (L%A_Index% = hwnd) + continue + DllCall("SetWindowPos" + , "UInt", L%A_Index%, "UInt", 1 ; HWND_BOTTOM + , "Int", 0, "Int", 0, "Int", 0, "Int", 0 + , "UInt", 0x0001|0x0002|0x4000) ; SWP_NOSIZE|SWP_NOMOVE|SWP_ASYNCWINDOWPOS + } +} +return + #t::WinSet, AlwaysOnTop, Toggle, A +#o::WinSet, AlwaysOnTop, Toggle, A #f:: WinGet, t, Transparent, A if (t = OFF) -- cgit v1.2.3