petrojelly Posted May 20, 2006 Posted May 20, 2006 Hi is it possible to minimize a window into system tray and restore it by double clicking on its tray icon ? Thanks for the help.
Valuater Posted May 20, 2006 Posted May 20, 2006 Hi is it possible to minimize a window into system tray and restore it by double clicking on its tray icon ? Thanks for the help.a place to lookhttp://www.autoitscript.com/forum/index.ph...704&hl=systray#8)
petrojelly Posted May 20, 2006 Author Posted May 20, 2006 Hi thanks for the link. But that thread doesn't seem to have what i need. The closest thing i can come up is to create a GUI without taskbar icon an minimize/restore the window with a hotkey.
menet Posted May 23, 2006 Posted May 23, 2006 I am also looking for same thing i suppose : a little script to put an application, which is already running (minimized or not), in the tray bar and minimized. Later, it should be possible to restore this application, just doing a simple or double clic. If somebody can provide us that, we will be very happy. Best Regards
BigDod Posted May 23, 2006 Posted May 23, 2006 How about using WinSetState, see example in help file for use. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
ChrisL Posted May 23, 2006 Posted May 23, 2006 (edited) expandcollapse popup#include <GuiConstants.au3> #include <Constants.au3> Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) Opt("TrayIconHide", 0) TraySetOnEvent($TRAY_EVENT_PRIMARYUP,"SpecialEvent") TraySetState() GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_MINIMIZE GuiSetState(@SW_HIDE) Opt("TrayIconHide", 0) Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Func SpecialEvent() GuiSetState(@SW_Show) Opt("TrayIconHide", 1) EndFunc Edited May 23, 2006 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
rnj Posted May 24, 2006 Posted May 24, 2006 Hi Chris, When running the above code..I am getting the variable used before declaration error C:\Scraps\test1.au3(8,37) : WARNING: $TRAY_EVENT_PRIMARYUP: possibly used before declaration. TraySetOnEvent($TRAY_EVENT_PRIMARYUP, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Scraps\test1.au3(8,37) : ERROR: $TRAY_EVENT_PRIMARYUP: undeclared global variable. TraySetOnEvent($TRAY_EVENT_PRIMARYUP, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ Using BETA version.. cheers, [font="Franklin Gothic Medium"]RnJ[/font][font="Franklin Gothic Medium"]Script: AutoIT v3.1.1.124 (beta)[/font][font="Franklin Gothic Medium"]OS: Windows XP/2000[/font]
mr.underperson Posted May 24, 2006 Posted May 24, 2006 I prefer single-click, and usually do something like this...; example single-click to toggle main window #include <Constants.au3> AutoItSetOption("TrayMenuMode", 9) AutoItSetOption("TrayOnEventMode", 1) ; left-click to show/hide the main window. TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN, "Toggle") TraySetClick(8) ; right-click to bring up the menu TraySetState() ; show the tray menu TraySetToolTip ("left-click to toggle the main window") TrayCreateItem("Quit") TrayItemSetOnEvent(-1,"Quit") $me = "example" $gui = GUICreate($me, 300, 300,) GUISetState() $quit = 0 while $quit = 0 wend func Quit() $quit = 1 endfunc func Toggle() $winstate = WinGetState($gui) if BitAnd($winstate, 2) then GUISetState(@SW_HIDE) else GUISetState(@SW_SHOW) endif endfunc-mups. I left in the extra "," after the width declaration because I have a running theme going (which no one will spot unless I mention it) of typos that still work. hahah
ChrisL Posted May 24, 2006 Posted May 24, 2006 Hi Chris,When running the above code..I am getting the variable used before declaration errorC:\Scraps\test1.au3(8,37) : WARNING: $TRAY_EVENT_PRIMARYUP: possibly used before declaration.TraySetOnEvent($TRAY_EVENT_PRIMARYUP,~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^C:\Scraps\test1.au3(8,37) : ERROR: $TRAY_EVENT_PRIMARYUP: undeclared global variable.TraySetOnEvent($TRAY_EVENT_PRIMARYUP,~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^Using BETA version..cheers,Which beta?The $tray_event_primaryup is declared int he constsnts.au3 file so did you leave the include constants.au3 at the top?If not you could replace it with TraySetOnEvent(-8,"SpecialEvent") and leave out the constants file [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
ChrisL Posted May 24, 2006 Posted May 24, 2006 I prefer single-click, and usually do something like this...it is single click, it responds to a mouse up on the tray icon [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
ChrisL Posted May 24, 2006 Posted May 24, 2006 ChrisL, I wasn't referring to your code.-muOh sorry [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
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