3

I am looking for a script to toggle between minimize and restore for Windows 7.

Flyk
  • 1,549
Carlos
  • 311

2 Answers2

6

Toggling between Minimize and Restore doesn't make much sense as you'll need the Window in focus (or some other way) to send it the command.

Assuming you really mean toggle between Maximize and Restore...

I have these in my AutoHotkey.ahk. You'll be interested in the "F3" mapping which really is Ctrl-Shift-3 in my setup.

;-----------------------------------------------------------------------------------
; Shortcut keys to Minimize, Maximize/Restore the current Window {{{1
; Meant to operate as the 3 right buttons on the window
;
;                                         Alt-F2         = AutoHotkey
;                                            Alt-F3      = AutoHotkey
;                                                 Alt-F4 = Default Windows
; +----------------------------------------------------+
; |                                        [_] [ ] [X] |
; +----------------------------------------------------+
; |                                                    |
; |                                                    |
;-----------------------------------------------------------------------------------
!F2:: WinMinimize, A
!F3::
WinGet MX, MinMax, A
If MX
WinRestore A
Else WinMaximize A
return

^+2:: WinMinimize, A
^+3::
WinGet MX, MinMax, A
If MX
WinRestore A
Else WinMaximize A
return
^+4:: WinClose, A
pottsdl
  • 641
  • While I didn't need all of this, I was able to use some of your code to enable me to do what I need it. Thanks a lot for your help. – Carlos Mar 21 '12 at 11:07
4

Why not try Win + Up while a window is selected to maximise it.

When the window is maximised a quick Win + Down will restore it to it's unmaximised potential, and a further Win + Down will minimise it to the tray.

SecurityMatt
  • 3,160