Using AutoHotkey, How can I bind a hotkey to stretch/maximize/span a window across multiple monitors so that it covers both displays?
Right now, I have to do this by manually stretching the windows with the mouse. I know there are dedicated tools that do this, but I'm already running an AutoHotkey script and would rather limit the number of tools I keep running.
On the Windows desktop, right-click an empty area and select the Display settings option. Scroll down to the Multiple displays section. Below the Multiple displays option, click the drop-down menu and select Extend these displays.
Access the control panel by right-clicking on your desktop and then choosing Graphics properties. When the control panel opens up, select Display, then Multiple Displays. Under Select Display Mode, click on Collage. Under the submenu that will appear, choose Enable.
If you want to move a window to a display located to the left of your current display, press Windows + Shift + Left Arrow. If you want to move a window to a display located to the right of your current display, press Windows + Shift + Right Arrow.
Here's how I did it, mapping the Shift + Windows + Up
combination to maximize a window across all displays. This compliments Windows 7's Windows + Up
hotkey, which maximizes the selected window.
+#Up::
WinGetActiveTitle, Title
WinRestore, %Title%
SysGet, X1, 76
SysGet, Y1, 77
SysGet, Width, 78
SysGet, Height, 79
WinMove, %Title%,, X1, Y1, Width, Height
return
+#Up::
{
Title := WinGetTitle("A")
WinRestore(Title)
X1 := SysGet(76)
Y1 := SysGet(77)
Width := SysGet(78)
Height := SysGet(79)
WinMove(X1, Y1, Width, Height, Title)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With