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.

Maximize window across multiple displays
Started by
jaxelrod
, Mar 22 2012 06:50 PM
3 replies to this topic
#1
-
Posted 22 March 2012 - 06:50 PM

Check out my blog, http://www.tipninja.com where I share tips from optimizing your PC use, to cooking and food storage and household organization to personal happiness.
I am not aware of any script... But that doesn't mean you can't make a short one. Let's see... Due to you can position your screens offset or in any position to the first one, just adding the screens together won't work. So in that case... I would probably do this....
this has been tested, but there might be shortcuts I could have used. Anyways, ScrollLock the first time to set internal settings (Which are saved and reused), all following times sets to the same settings last used. Nifty eh?
this has been tested, but there might be shortcuts I could have used. Anyways, ScrollLock the first time to set internal settings (Which are saved and reused), all following times sets to the same settings last used. Nifty eh?

;author: Era Scarecrow ;Date: 22 March 2012 ;Description: select a single window for set offset/width/height. ; Originally intended for working with multiple monitors/screens. section = Setting1 writable = 1 ;If 0, no ini-file and resettable each time script is used. IniRead, x1, singleMax.ini, %section%, OffsetX, -1 IniRead, y1, singleMax.ini, %section%, OffsetY, -1 IniRead, width, singleMax.ini, %section%, Width, -1 IniRead, height, singleMax.ini, %section%, Height, -1 return ScrollLock:: ;if missing, we save our current settings on the current window. WinGetActiveTitle, Title if (x1 = -1 || y1 = -1 || width = -1 || height = -1) { WinGetPos, X1, Y1, Width, Height, %title% if (writable) { IniWrite, %X1%, singleMax.ini, %section%, OffsetX IniWrite, %Y1%, singleMax.ini, %section%, OffsetY IniWrite, %Width%, singleMax.ini, %section%, Width IniWrite, %Height%, singleMax.ini, %section%, Height } return } WinMove, %Title%,, X1, Y1, Width, Height return
#2
-
Posted 22 March 2012 - 08:07 PM

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
#3
-
Posted 22 March 2012 - 08:44 PM

Check out my blog, http://www.tipninja.com where I share tips from optimizing your PC use, to cooking and food storage and household organization to personal happiness.
I was getting confused in the documentation, it kept referring to 'last found window' in the different commands. But if it works for you as you have it, more power to you

#4
-
Posted 22 March 2012 - 09:00 PM
