Last active
April 14, 2023 08:21
-
-
Save Zebiano/6798e00ab188c7b23413c92fbeb49c53 to your computer and use it in GitHub Desktop.
Maximize Window through monitors with Auto Hot Key on Windows.
This file contains hidden or 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
; Credit goes to Jeff Axelrod (https://stackoverflow.com/users/403455/jeff-axelrod) https://stackoverflow.com/a/9830200/470749 | |
+#Up:: | |
WinGetActiveTitle, Title | |
WinRestore, %Title% | |
SysGet, X1, 76 | |
SysGet, Y1, 77 | |
SysGet, Width, 78 | |
SysGet, Height, 79 | |
WinMove, %Title%, , X1, Y1, Width, Height | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Auto-start script on boot
You can easily have this script run on Windows boot by creating a shortcut of the script (
Right click
->Create shortcut
), and putting it into the WindowsStart-up
folder (Windows+R
->shell:startup
).Customization
You can also customise the script!
WinMove
uses a startingX
andY
, as well as aWidth
andHeight
to resize the window. Keep in mind that having monitors with different resolutions and/or scalings will most likely result in unwanted outcomes. You can, however, manually fix these if you have the patience for it. Here are some examples:Horizontal monitors
This will expand a window through every monitor you have. Only works if all your monitors are horizontally set up.
WinMove, %Title%, , X1, Y1, Width, Height
Triple horizontal monitors: expand only on two monitors
In case you're running a triple horizontal monitor setup, and only want a window to resize over two monitors, run this script:
Triple monitors: two horizontal and one vertical
If you're running a triple monitor setup, where two are horizontally aligned and the third one is either above or below, you'll want to only stretch the height of the window by the two horizontal monitors.
Please keep in mind that you might be assigning variables unnecessarily if you end up using custom values.