AutoIt – Minimize and Restore Window

email me

It’s best to separate these events into two separate files. Compile to x86 EXE. Call to minimize.exe in your scripts.

minimize.au3

; Hide the tray icon.
Opt("TrayIconHide", 1)

WinSetState("Title of your Window","",@SW_MINIMIZE)
Run("taskkill /f /im restore.exe", "", @SW_MINIMIZE)
Sleep(2000)
Run("restore.exe", "", @SW_SHOWMAXIMIZED)

 

restore.au3

; Hide the tray icon.
Opt("TrayIconHide", 1)

sleep(20000);20 seconds
;sleep(86400000); 24 hours
WinSetState("Title of your Window","",@SW_RESTORE)

 

Notes

;@SW_HIDE = Hide window
; @SW_SHOW = Shows a previously hidden window
; @SW_MINIMIZE = Minimize window
; @SW_MAXIMIZE = Maximize window
; @SW_RESTORE = Undoes a window minimization or maximization
; @SW_DISABLE = Disables the window
; @SW_ENABLE = Enables the

 

tags: MrNetTek