RagnaroktA Posted August 18, 2005 Share Posted August 18, 2005 Is there a way to have a GUI minimize to the system tray when the minimize button is pressed? Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki Link to comment Share on other sites More sharing options...
Lazycat Posted August 18, 2005 Share Posted August 18, 2005 (edited) Beta have tray functions. Download it and look for examples. Edited August 18, 2005 by Lazycat Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
RagnaroktA Posted August 18, 2005 Author Share Posted August 18, 2005 Beta have tray functions. Download it and look for examples.<{POST_SNAPBACK}>All I can find in the beta is tray menu functions... nothing about minimizing the GUI to the tray... Am I just blind? Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki Link to comment Share on other sites More sharing options...
CyberSlug Posted August 19, 2005 Share Posted August 19, 2005 Updated from a post a while back:#include <GuiConstants.au3> Global Const $TRAY_DEFAULT = 512 #NoTrayIcon;at least not icon at the very beginning Opt("TrayAutoPause", 0) Opt("TrayMenuMode", 1) GuiCreate("Minimzes to tray") GuiSetState(@SW_SHOW) $foo = TrayCreateItem("Restore Window") TrayItemSetState(-1, $TRAY_DEFAULT) TraySetClick ( 0 );don't show menu item when clicked TraySetToolTip("Click to restore window...");Does this function work? While 1 $trayMsg = TrayGetMsg() If $trayMsg = $foo Then GuiSetState(@SW_SHOW);show GUI Opt("TrayIconHide", 1);hide tray icon EndIf $msg = GuiGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit If $msg = $GUI_EVENT_MINIMIZE Then GuiSetState(@SW_HIDE);hide GUI Opt("TrayIconHide", 0);show tray icon EndIf WEndForum search "+minimize +tray" Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
chie Posted November 13, 2006 Share Posted November 13, 2006 lets suppose there are 3 or more GUIs & if you press: $GUI_EVENT_MINIMIZE on GUI1 then all GUIS = @SW_HIDE, else = @SW_MINIMIZE ONLY the window where the $GUI_EVENT_MINIMIZE was pressed. So I was experimenting, but this is really confusing ( I tried to use same principle as the $GUI_EVENT_CLOSE in this sample but as you see someting realy wierd happened ), also wierd things happened when i tried to set if winactive .. then @SW_HIDE etc. To be honest my logic is at its end hire atm. so all ideas how to explane this wierd behavior are welcome Case $msg = $GUI_EVENT_MINIMIZE $Hwnd = WinGetHandle('') If $Hwnd = $GUI1 Then GUISetState(@SW_HIDE) Else gUISetState(@SW_MINIMIZE) EndIfoÝ÷ Ù&¦¦WP¨uì"¶ÆPºÚ"µÍÚ[ÛYH ÑÝZPÛÛÝ[Ë]LÉÝÂßÜ ][ÝÕÚ[]SX]Ú[ÙI][ÝËHÈÙH[HÙHÚ[ÝÈ[YBßPZ[Ú[ÝÂßKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKBÌÍÑÕRLHHÕRPÜX]J ][ÝÑÕRLI][ÝËÌL BÌÍÓÒÈHÕRPÝÜX]P]Û ][ÝÔÚÝÈÕRL][ÝË L ÌÊHÐ]ÛÒÈ YÜÚYZYÚ BÌÍÓÒÌHÕRPÝÜX]P]Û ][ÝÔÚÝÈÕRLÉ][ÝËN L ÌÊHÐ]ÛÒÈ YÜÚYZYÚ BÕRTÙ]Ý]JÕ×ÔÒÕÊBßÕRL [ÈÂßKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKBÌÍÑÕRLHÕRPÜX]J ][ÝÑÕRL][ÝËÌL JHÈÕRLÚ[Ý×Ø[ÝÛÙÚ[ÛÜ[Û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ù][J ÌÎNÉÌÎNÊBBBBY ÌÍÒÛH ÌÍÑÕRLH[^][ÙRY ÌÍÒÛH ÌÍÑÕRL[ÕRTÙ]Ý]JÕ×ÒQK ÌÍÑÕRLHBQ[ÙRY ÌÍÒÛH ÌÍÑÕRLÈ[ÕRTÙ]Ý]JÕ×ÒQK ÌÍÑÕRLÊHBQ[YBPØÙH ÌÍÛÙÈH ÌÍÓÒÈÕRTÙ]Ý]JÕ×ÔÒÕË ÌÍÑÕRLBBPØÙH ÌÍÛÙÈH ÌÍÓÒÌÕRTÙ]Ý]JÕ×ÔÒÕË ÌÍÑÕRLÊB[Ù[XÝÑ[ Link to comment Share on other sites More sharing options...
LeCarre Posted December 24, 2011 Share Posted December 24, 2011 Small tweak to get that tooltip working Move the line to "after visible tooltip" Updated from a post a while back: #include <GuiConstants.au3> Global Const $TRAY_DEFAULT = 512 #NoTrayIcon;at least not icon at the very beginning Opt("TrayAutoPause", 0) Opt("TrayMenuMode", 1) GuiCreate("Minimzes to tray") GuiSetState(@SW_SHOW) $foo = TrayCreateItem("Restore Window") TrayItemSetState(-1, $TRAY_DEFAULT) TraySetClick ( 0 );don't show menu item when clicked ; TraySetToolTip("Click to restore window...") ;Does this function work? While 1 $trayMsg = TrayGetMsg() If $trayMsg = $foo Then GuiSetState(@SW_SHOW);show GUI Opt("TrayIconHide", 1);hide tray icon EndIf $msg = GuiGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit If $msg = $GUI_EVENT_MINIMIZE Then GuiSetState(@SW_HIDE);hide GUI Opt("TrayIconHide", 0);show tray icon TraySetToolTip("Click to restore window...") ; The Tooltip text is only changed when the tray icon is visible. EndIf WEnd Forum search "+minimize +tray" Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 24, 2011 Moderators Share Posted December 24, 2011 LeCarre, Thanks for taking the trouble to post amended code, but we discourage necro-posting - 5 years since the previous post is far too long! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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