AutoHotkey: Toggle Maximize Window

By Xah Lee. Date: . Last updated: .

Here's AutoHotkey script to toggle maximize window.

[see AutoHotkey Tutorial]

; toggle maximize/restore current window
; Version 2021-02-21, 2021-05-26
; http://xahlee.info/mswin/autohotkey_toggle_maximize_window.html
toggleMaxWindow()
{
  WinGet, WinState, MinMax, A
  if (WinState = 1)
  {
    WinRestore, A
  }
  else
  {
    WinMaximize, A
  }
}

2021-05-26 thanks R34P3R for help.

AutoHotkey Tutorial

AutoHotkey logo nz9fX