From 6348db6799aede103ed69522affc79411cb67e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 1 Dec 2020 22:42:41 +0100 Subject: Switch from spaces to tabs --- tt.windows.ahk | 82 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) (limited to 'tt.windows.ahk') diff --git a/tt.windows.ahk b/tt.windows.ahk index b8eb857..ec6532c 100644 --- a/tt.windows.ahk +++ b/tt.windows.ahk @@ -18,9 +18,9 @@ Gui, FakeWindow:Show, x0 y%y% AutoSize NA, FakeWindow #y:: WinGet, t, Transparent, A if (t = OFF) - WinSet, Transparent, 180, A + WinSet, Transparent, 180, A else - WinSet, Transparent, OFF, A + WinSet, Transparent, OFF, A return #b::WinSet, Bottom,, A #!m::WinMove, A,, 0, 0 @@ -29,9 +29,9 @@ return #v:: WinGet, mm, MinMax, A if (mm = 1) - WinRestore, A + WinRestore, A else - WinMaximize, A + WinMaximize, A return #x:: ; minimize all except current @@ -44,7 +44,7 @@ WinSet, Style, % s, ahk_id %hwnd% WinActivate, ahk_id %hwnd% WinGet, mm, MinMax, ahk_id %hwnd% if (mm = -1) - WinRestore, ahk_id %hwnd% + WinRestore, ahk_id %hwnd% return #c:: ; minimize last window @@ -78,14 +78,14 @@ return $!Tab:: HandleAltTab: if (WindowDisabled) - WinSet, Disable,, ahk_id %WindowDisabled% + WinSet, Disable,, ahk_id %WindowDisabled% SendInput, {LAlt Down}{Tab} Hotkey, $!Tab, HandleAltTab, Off Hotkey, $!+Tab, HandleAltShiftTab, Off while (GetKeyState("LAlt", "P") and not esc := GetKeyState("Esc", "P")) - Sleep, 1 + Sleep, 1 if (esc) - SendInput, {Esc} + SendInput, {Esc} SendInput, {LAlt Up} Hotkey, $!Tab, HandleAltTab, On Hotkey, $!+Tab, HandleAltShiftTab, On @@ -95,17 +95,17 @@ return $!+Tab:: HandleAltShiftTab: if (WindowDisabled) - WinSet, Disable,, ahk_id %WindowDisabled% + WinSet, Disable,, ahk_id %WindowDisabled% if (WinActive("A") = WindowDisabled) - SendInput, {LAlt Down}{LShift Down}{Tab}{LShift Up}{Tab} + SendInput, {LAlt Down}{LShift Down}{Tab}{LShift Up}{Tab} else - SendInput, {LAlt Down}{LShift Down}{Tab}{LShift Up} + SendInput, {LAlt Down}{LShift Down}{Tab}{LShift Up} Hotkey, $!Tab, HandleAltTab, Off Hotkey, $!+Tab, HandleAltShiftTab, Off while (GetKeyState("LAlt", "P") and not esc := GetKeyState("Esc", "P")) - Sleep, 1 + Sleep, 1 if (esc) - SendInput, {Esc} + SendInput, {Esc} SendInput, {LAlt Up} Hotkey, $!Tab, HandleAltTab, On Hotkey, $!+Tab, HandleAltShiftTab, On @@ -118,8 +118,8 @@ hwndp := WinActive("A") MouseGetPos,,, hwnd if (hwnd = hwndp) { - WinSet, Top,, A - return + WinSet, Top,, A + return } DllCall("SetForegroundWindow", "UInt", hwnd) WinSet, AlwaysOnTop, On, ahk_id %hwndp% @@ -132,15 +132,15 @@ return WindowsWindowMessage(wParam, lParam) { - static HSHELL_GETMINRECT := 5 - ; The active window is 0 during minimization (if animated) - if (wParam = HSHELL_GETMINRECT and WinActive("A") = 0) - { - hwnd := NumGet(lParam + 0) - WinWaitNotActive, ahk_id 0 - Sleep, 20 - InsertAfter(hwnd, "BOTTOM") - } + static HSHELL_GETMINRECT := 5 + ; The active window is 0 during minimization (if animated) + if (wParam = HSHELL_GETMINRECT and WinActive("A") = 0) + { + hwnd := NumGet(lParam + 0) + WinWaitNotActive, ahk_id 0 + Sleep, 20 + InsertAfter(hwnd, "BOTTOM") + } } ;; -> init @@ -153,21 +153,21 @@ WindowMessageHandlers.Push("WindowsWindowMessage") InsertAfter(hwnd = "", position = "BOTTOM") { - static SWP_NOSIZE := 0x0001 - static SWP_NOMOVE := 0x0002 - static SWP_ASYNCWINDOWPOS := 0x4000 - static HWND_BOTTOM := 1 - static HWND_NOTOPMOST := -2 - static HWND_TOP := 0 - static HWND_TOPMOST := -1 - if (hwnd = "") - WinGet, hwnd, id, A - DllCall("SetWindowPos" - , "UInt", hwnd - , "UInt", HWND_%position% - , "Int", 0 - , "Int", 0 - , "Int", 0 - , "Int", 0 - , "UInt", SWP_NOSIZE | SWP_NOMOVE | SWP_ASYNCWINDOWPOS) + static SWP_NOSIZE := 0x0001 + static SWP_NOMOVE := 0x0002 + static SWP_ASYNCWINDOWPOS := 0x4000 + static HWND_BOTTOM := 1 + static HWND_NOTOPMOST := -2 + static HWND_TOP := 0 + static HWND_TOPMOST := -1 + if (hwnd = "") + WinGet, hwnd, id, A + DllCall("SetWindowPos" + , "UInt", hwnd + , "UInt", HWND_%position% + , "Int", 0 + , "Int", 0 + , "Int", 0 + , "Int", 0 + , "UInt", SWP_NOSIZE | SWP_NOMOVE | SWP_ASYNCWINDOWPOS) } -- cgit v1.2.3