Created
December 30, 2022 09:48
-
-
Save daftspaniel/c2a443efffe376b90855cd868ac5e170 to your computer and use it in GitHub Desktop.
AutoHotkey 2.0 Window Controls
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
; HOTKEYS - Ctrl + F1 etc | |
^F1::CenterActiveWindow() | |
^F2::FocusActiveMinOthers() | |
^F3::NarrowActiveWindow() | |
CenterActiveWindow() | |
{ | |
windowWidth := A_ScreenWidth * 0.9 ; desired width | |
windowHeight := A_ScreenHeight * 0.92 ; desired height | |
windowName := WinGetTitle("A") | |
WinRestore windowName | |
WinMove A_ScreenWidth/2-(windowWidth/2), 25, windowWidth, windowHeight, windowName | |
} | |
FocusActiveMinOthers() | |
{ | |
windowName := WinGetTitle("A") | |
WinMinimizeAll | |
WinRestore windowName | |
CenterActiveWindow() | |
} | |
NarrowActiveWindow() | |
{ | |
windowWidth := A_ScreenWidth * 0.5 ; desired width | |
windowHeight := A_ScreenHeight * 0.92 ; desired height | |
windowName := WinGetTitle("A") | |
WinRestore windowName | |
WinMove A_ScreenWidth/2-(windowWidth/2), 25, windowWidth, windowHeight, windowName | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment