AutoHotkey: Script to Toggle Maximize Window

Perm url with updates:

AutoHotkey: Script to Toggle Maximize Window

Xah Lee, 2011-05-02

This page is a simple AutoHotkey script to toggle the current window's size. If you don't know what AutoHotkey is, see AutoHotkey Basics.

; 2011-04-30
; from
; A toggle. maximize current window, or restor size if already maximized.

WinGetPos, winWidth, winHeight, , , A  ; "A" to get the active window's pos.
if ( winWidth == -8 and winHeight == -8) {
WinRestore, A
} else
WinMaximize, A


Save the above in a file, name it 〔toggle window maximize restore.ahk〕.

Then, in your main AutoHotkey file, you can assign a key to it, like this:

$ScrollLock::Run "toggle window maximize restore.ahk"

Or, you can use your Microsoft or Logitech software keyboard driver software to assign a key to launch the script.

Popular posts from this blog

11 Years of Writing About Emacs

does md5 creates more randomness?

Google Code shutting down, future of ErgoEmacs