ONE KEY TO TOGGLE MIN/RESTORE WINDOW
Author SGP
Message No.

http://groups.yahoo.com/group/power-pro/message/13193

File Name Toggle_MinRes.powerpro
Requirements No special requirements
Variables substitute "TheCaption" and "TheApp" variable values as suitable
Description: Use a single Hotkey to toggle the status of a window between Minimized and Restored sizes/positions

; assign this script to a hotkey for a 1+2 cycle button:
; if app not running then start it
; else cycle: hide/show window (or minimize/restore it)
; substitute "TheCaption" and "TheApp" as suitable and
; uncomment desired behavior

local caption
caption="TheCaption"
If ( 0 == anywindow(caption) ) Do
  "%ProgramFiles%\TheApp.exe"
Else

;   use this to cycle between hiding and showing the window
;   *Window HideShow! &(caption)

;  use this to cycle between minimizing to taskbar and restoring the window
;   *Window MinRestore &(caption)

;  use this to cycle between minimizing to tray and restoring the window
  If(VisibleWindow(caption)) Do
    *Window TrayMin! &(caption)
  Else
    *Window Show! &(caption)
  EndIf
Endif