Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I maximize a window across multiple monitors?

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.

like image 221
Jeff Axelrod Avatar asked Mar 22 '12 19:03

Jeff Axelrod


People also ask

How do I maximize a window in two monitors?

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.

How do I stretch an app across two monitors?

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.

How do I move a window maximized to another monitor?

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.


1 Answers

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.

AHK v1
+#Up::
    WinGetActiveTitle, Title
    WinRestore, %Title%
   SysGet, X1, 76
   SysGet, Y1, 77
   SysGet, Width, 78
   SysGet, Height, 79
   WinMove, %Title%,, X1, Y1, Width, Height
return
AHK v2
+#Up::
{
    Title := WinGetTitle("A")
    WinRestore(Title)
    X1 := SysGet(76)
    Y1 := SysGet(77)
    Width := SysGet(78)
    Height := SysGet(79)
    WinMove(X1, Y1, Width, Height, Title)
}
like image 154
Jeff Axelrod Avatar answered Sep 17 '22 06:09

Jeff Axelrod