Autohotkey: Resize windows

I was tired of moving and resizing windows by hand, so I created a small script for AutoHotKey that allows quick window organization. I added only what I need right now, so you have the following actions:

  • WIN+Up: Maximize current window
  • WIN+Down: Restore current window
  • WIN+Left: Put window to the left side of the screen
  • WIN+Right: Put window to the right side of the screen

The Left/Right actions are really useful if you like to work in splitscreen mode. I do that often, so this comes in handy. I think this little script allows for quick modification, so feel free to add any functionality you like to have.

#InstallKeybdHook
#Up::WinMaximize A
#Down::WinRestore A
#Left::LeftHalfWindow()
#Right::RightHalfWindow()

LeftHalfWindow()
{
SysGet, area, MonitorWorkArea
w:=((areaRight-areaLeft)/2)
h:=(areaBottom-areaTop)

WinRestore, A
WinMove, A, , 0, 0,%w%,%h%
}

RightHalfWindow()
{
SysGet, area, MonitorWorkArea
w:=((areaRight-areaLeft)/2)
h:=(areaBottom-areaTop)

WinRestore, A
WinMove, A, , w, 0, w, h   ;Middle of screen is same as w.
}

Über Carsten

Ich bin leidenschaftlicher Softwareentwickler, studierter Dipl.Ing. Elektrotechnik, Gaming-verrückt, Kraftsportler und Einsiedler.
Dieser Beitrag wurde unter Technik abgelegt und mit , , , , verschlagwortet. Setze ein Lesezeichen auf den Permalink.

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *

*

Du kannst folgende HTML-Tags benutzen: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>