James Posted August 19, 2007 Share Posted August 19, 2007 Hey, If anyone ever needs this then here you go. #include <Constants.au3> #include <GUIConstants.au3> #NoTrayIcon Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) TraySetOnEvent($TRAY_EVENT_PRIMARYUP, "Minimize") $GUI = GUICreate("Minimize me", 460, 400) GUICtrlCreateLabel("Press the minimize button to hide the window.", 125, 175) GUISetState(@SW_SHOW) While 1 $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE Exit Case $iMsg = $GUI_EVENT_MINIMIZE GuiSetState(@SW_HIDE) TraySetState(1) EndSelect WEnd Func Minimize() TraySetState(2) GuiSetState(@SW_SHOW) EndFunc -James Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
user52 Posted August 19, 2007 Share Posted August 19, 2007 i've change it just a bit for what i needed. thanks expandcollapse popup; toggle show/hide by clicking tray icon #include <Constants.au3> #include <GUIConstants.au3> Global $is_minimized = 0 Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) TraySetOnEvent($TRAY_EVENT_PRIMARYUP, "Toggle") $GUI = GUICreate("Minimize me", 460, 400) GUICtrlCreateLabel("Toggle show/hide by clicking tray icon", 125, 175) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_MINIMIZE GuiSetState(@SW_HIDE) $is_minimized = 1 debug("$is_minimized: " & $is_minimized) EndSwitch WEnd Func Toggle() If $is_minimized = 1 Then GuiSetState(@SW_SHOW) $is_minimized = 0 Else GuiSetState(@SW_HIDE) $is_minimized = 1 EndIf debug("$is_minimized: " & $is_minimized) EndFunc Func debug($a) ConsoleWrite(@SEC & " " & $a & @CRLF) EndFunc Link to comment Share on other sites More sharing options...
James Posted August 19, 2007 Author Share Posted August 19, 2007 Cool! Glad you're using them. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
gseller Posted August 20, 2007 Share Posted August 20, 2007 Cool! Some APPZ Just need a minimize... Link to comment Share on other sites More sharing options...
James Posted August 20, 2007 Author Share Posted August 20, 2007 (edited) Sure do Edited August 20, 2007 by JamesB Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ 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