KurogamineNox Posted June 20, 2010 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
MrFlibble Posted June 21, 2010 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
KurogamineNox Posted June 21, 2010 Author 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.
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