Regency Posted November 19, 2007 Share Posted November 19, 2007 I cant seem to figure out if there even is a finction in the GUI interface to do this. Anyone know something i dont... example script please if u know how to do this Link to comment Share on other sites More sharing options...
Richard Robertson Posted November 19, 2007 Share Posted November 19, 2007 If you want to minimize to the tray, you need to hide the window, then set up your own menu or click handler for the tray icon. Link to comment Share on other sites More sharing options...
smashly Posted November 19, 2007 Share Posted November 19, 2007 Hi, on event example...expandcollapse popup#include<GUIConstants.au3> #include <Constants.au3> #NoTrayIcon Opt("GUIOnEventMode", 1) Opt("GUIEventOptions", 1) Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) ;---Gui $Gui = GUICreate("Example Min to Tray", 260, 200, -1, -1, -1, $WS_EX_TOPMOST) GUISetOnEvent($GUI_EVENT_MINIMIZE, "GuiEvent", $Gui) GUISetOnEvent($GUI_EVENT_CLOSE, "GuiEvent", $Gui) GUISetState(@SW_SHOW, $Gui) ;---Tray $TrayRestore = TrayCreateItem("Restore Gui") TrayItemSetOnEvent(-1, "TrayEvent") TrayCreateItem("") $TrayExit = TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "TrayEvent") TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN, "TrayEvent") TraySetClick(16) While 1 Sleep(100) WEnd Func GuiEvent() Switch @GUI_CtrlId Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_MINIMIZE GUISetState(@SW_HIDE, $Gui) TraySetState(1) TraySetToolTip("Left click to Restore Gui." & @LF & "Right click to Restore or Exit Gui.") EndSwitch EndFunc Func TrayEvent() Switch @TRAY_ID Case $TrayRestore, $TRAY_EVENT_PRIMARYDOWN TraySetState(2) GUISetState(@SW_SHOW, $Gui) Case $TrayExit Exit EndSwitch EndFunc Cheers Link to comment Share on other sites More sharing options...
Madza91 Posted November 19, 2007 Share Posted November 19, 2007 This is better expandcollapse popup#include <GUiconstants.au3> #include <Constants.au3> Opt("TrayMenuMode",1) Opt("TrayAutoPause",0) TraySetClick(16) $min=False $Main=GUICreate("") GUISetState() ;Tray Menu $Show=TrayCreateItem("Show/Hide") TrayItemSetState(-1,$TRAY_DEFAULT) $Quit=TrayCreateItem("Quit") While 1 $gMsg=GUIGetMsg() Switch $gMsg Case $GUI_EVENT_CLOSE _Hide_Show() Case $GUI_EVENT_MINIMIZE _Hide_Show() EndSwitch $tMsg=TrayGetMsg() Switch $tMsg Case $Show _Hide_Show() Case $Quit Exit EndSwitch WEnd Func _Hide_Show() If $min Then GUISetState(@SW_SHOW,$Main) GUISetState(@SW_RESTORE,$Main) $min=False Else Guisetstate(@SW_MINIMIZE,$Main) Guisetstate(@SW_HIDE,$Main) $min=True EndIf EndFunc;==>Hide_Show Left double click on tray icon to Shoe/Hide or on close and minimize... [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
dani Posted November 19, 2007 Share Posted November 19, 2007 (edited) This is better ~code~ Left double click on tray icon to Shoe/Hide or on close and minimize... Please use the [ autoit ] and [/ autoit ] tags when posting AutoIt code Edited November 19, 2007 by D4ni Link to comment Share on other sites More sharing options...
Madza91 Posted November 19, 2007 Share Posted November 19, 2007 (edited) Shut up d4nI Edited November 19, 2007 by n3nE [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) 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