KurogamineNox Posted June 20, 2010 Share Posted June 20, 2010 (edited) How do you minimize your GUI(Window) to the icon area, and have it come back by double clicking the icon? Edited June 20, 2010 by KurogamineNox Link to comment Share on other sites More sharing options...
MrFlibble Posted June 21, 2010 Share Posted June 21, 2010 Is this what you mean? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> Opt ("TrayMenuMode", 1) #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 300, 300) GUISetState(@SW_SHOW) $restore = TrayCreateItem("Restore window") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() While 1 $Tmsg = TrayGetMsg() $GMsg = GUIGetMsg() Select Case $GMsg = $GUI_EVENT_CLOSE Exit Case $GMsg = $GUI_EVENT_MINIMIZE GUISetState(@SW_HIDE,$Form1) Case $Tmsg = 0 ContinueLoop Case $Tmsg = $TRAY_EVENT_PRIMARYDOUBLE Restore() Case $Tmsg = $exititem ExitLoop EndSelect WEnd Func Restore() GUISetState(@SW_SHOW) GUISetState(@SW_RESTORE) EndFunc Link to comment Share on other sites More sharing options...
KurogamineNox Posted June 21, 2010 Author Share Posted June 21, 2010 Is this what you mean? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> Opt ("TrayMenuMode", 1) #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 300, 300) GUISetState(@SW_SHOW) $restore = TrayCreateItem("Restore window") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() While 1 $Tmsg = TrayGetMsg() $GMsg = GUIGetMsg() Select Case $GMsg = $GUI_EVENT_CLOSE Exit Case $GMsg = $GUI_EVENT_MINIMIZE GUISetState(@SW_HIDE,$Form1) Case $Tmsg = 0 ContinueLoop Case $Tmsg = $TRAY_EVENT_PRIMARYDOUBLE Restore() Case $Tmsg = $exititem ExitLoop EndSelect WEnd Func Restore() GUISetState(@SW_SHOW) GUISetState(@SW_RESTORE) EndFunc It worked, 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