Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Maximize window across multiple displays


  • Please log in to reply
3 replies to this topic
jaxelrod
  • Members
  • 12 posts
  • Last active: Mar 26 2012 01:09 AM
  • Joined: 28 Mar 2008
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.
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.

rtcvb32
  • Members
  • 542 posts
  • Last active: Apr 04 2012 03:59 AM
  • Joined: 17 Feb 2008
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? :)

;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


jaxelrod
  • Members
  • 12 posts
  • Last active: Mar 26 2012 01:09 AM
  • Joined: 28 Mar 2008
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

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.

rtcvb32
  • Members
  • 542 posts
  • Last active: Apr 04 2012 03:59 AM
  • Joined: 17 Feb 2008
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 :)