Zachlr Posted March 18, 2009 Share Posted March 18, 2009 I've seen many programs out there that will minimize the application to the task tray when the GUI is closed, and then come back when the tray item is clicked. Is there a feature built in to AutoIT3 for this? Can it be done by minimizing and then hiding (or just hiding for that matter) the window? I have tried $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUISetState(@SW_MINIMIZE, $LogViewer) GUISetState(@SW_HIDE, $LogViewer) EndSwitch but it doesn't seem to work. The GUI still closes, and I can't just create a new one because there are data in the controls that need to remain there. The answer is probably right in front of me, but I'm not seeing it. Thanks, Zach Link to comment Share on other sites More sharing options...
foster74 Posted March 18, 2009 Share Posted March 18, 2009 Hope this is what you are looking: #include <GUIConstants.au3> #include <IE.au3> #include <Constants.au3> Opt("TrayOnEventMode",1) Opt("TrayAutoPause",0) $LogViewer = GUICreate('whatever',300,300) guisetstate() TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN, "max") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUISetState(@SW_MINIMIZE, $LogViewer) GUISetState(@SW_HIDE, $LogViewer) EndSwitch Wend Func max() GUISetState(@SW_RESTORE, $LogViewer) GUISetState(@SW_SHOW, $LogViewer) EndFunc Link to comment Share on other sites More sharing options...
Zachlr Posted March 18, 2009 Author Share Posted March 18, 2009 Yep! Works like a charm. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now