Skip to content

Commit

Permalink
v1.4
Browse files Browse the repository at this point in the history
-Fixed random crash after restoring all windows
  • Loading branch information
sandwichdoge authored Apr 26, 2018
1 parent 81dceae commit a10e2da
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions MinimizeToTray.au3
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\Icons\MTT.ico
#AutoIt3Wrapper_Outfile=..\..\Soft\MinimizeToTray.Exe
#AutoIt3Wrapper_Res_Comment=Minimize Windows to Tray
#AutoIt3Wrapper_Res_Description=Minimize Windows to Tray
#AutoIt3Wrapper_Res_Fileversion=1.4
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;//Minimize to tray
;//[email protected]
#include <Array.au3>
$sVersion = "1.3"
$sVersion = "1.4"

HotKeySet("!{f1}", "HideCurrentWnd")
HotKeySet("!{f2}", "RestoreLastWnd")
Expand Down Expand Up @@ -99,21 +106,18 @@ EndFunc ;==>HideCurrentWnd

Func RestoreAllWnd()
;//Show all windows hidden during this session.
For $i = 0 To UBound($aHiddenWndList) - 1
WinSetState($aHiddenWndList[$i], "", @SW_SHOW)
Local $aTmp = $aHiddenWndList
For $i = 0 To UBound($aTmp) - 1
RestoreWnd($aTmp[$i])
Next
For $i = 0 To UBound($aTrayItemHandles) - 1
TrayItemDelete($aTrayItemHandles[$i])
_ArrayDelete($aHiddenWndList, $i)
Next
Global $aTrayItemHandles[0] = []
FileDelete("MTTlog.txt")
EndFunc ;==>RestoreAllWnd

Func Help()
MsgBox(64, "MinimizeToTray " & $sVersion, "Press [Alt+F1] to hide currently active Window." & @CRLF _
& "Press [Alt+F2] to restore last hidden Window." & @CRLF _
& "Hidden Windows are stored in MTT tray icon." & @CRLF & @CRLF _
& "Hidden Windows are stored in MTT tray icon." & @CRLF _
& "If the window you want to hide is elevated to administrative level, you must run MTT as Administrator." & @CRLF & @CRLF _
& "[email protected]")
EndFunc ;==>Help

Expand Down

0 comments on commit a10e2da

Please sign in to comment.