Darkbeo Posted June 5, 2008 Share Posted June 5, 2008 (edited) How i can close this GUI on click OK? expandcollapse popup;~ -------------------------------------------------------------------------------------------- ;~ Includes ;~ -------------------------------------------------------------------------------------------- #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ;~ -------------------------------------------------------------------------------------------- ;~ -------------------------------------------------------------------------------------------- ;~ Opções de Parametros/Funções ;~ -------------------------------------------------------------------------------------------- Opt("TrayMenuMode",1) ;~ -------------------------------------------------------------------------------------------- ;~ -------------------------------------------------------------------------------------------- ;~ Menu do SistemTray ;~ -------------------------------------------------------------------------------------------- $aboutitem = TrayCreateItem("About...") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() TraySetToolTip("Test") ;~ -------------------------------------------------------------------------------------------- ;~ -------------------------------------------------------------------------------------------- ;~ Funções do About... ;~ -------------------------------------------------------------------------------------------- Func About() #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("About", 324, 241, 303, 219, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS)) GUISetIcon("D:\006.ico") $GroupBox1 = GUICtrlCreateGroup("", 8, 8, 305, 185) $Image1 = GUICtrlCreatePic("", 16, 24, 105, 97) $Label1 = GUICtrlCreateLabel("Product Name", 152, 24, 72, 17, $WS_GROUP) $Label2 = GUICtrlCreateLabel("Version", 152, 48, 39, 17, $WS_GROUP) $Label4 = GUICtrlCreateLabel("Comments", 16, 160, 53, 17, $WS_GROUP) $Label3 = GUICtrlCreateLabel("Copyright", 16, 136, 48, 17, $WS_GROUP) GUICtrlCreateGroup("", -99, -99, 1, 1) $Button1 = GUICtrlCreateButton("&OK", 112, 208, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;~ -------------------------------------------------------------------------------------------- ;~ -------------------------------------------------------------------------------------------- ;~ While de Repetição dos comandos ;~ -------------------------------------------------------------------------------------------- While 1 $msgTray = TrayGetMsg() Select Case $msgTray = $aboutitem About() Case $msgTray = $exititem Exit EndSelect Sleep(50) WEnd ;~ -------------------------------------------------------------------------------------------- Thanks if can help me.... Edited June 5, 2008 by Darkbeo Link to comment Share on other sites More sharing options...
newbiescripter Posted June 5, 2008 Share Posted June 5, 2008 (edited) Just use this case like you do with the others: Case $button1 Exit Regards EDIT: Sorry i was too fast.. give me a little time then I'll post how to do. Edited June 5, 2008 by newbiescripter Link to comment Share on other sites More sharing options...
newbiescripter Posted June 5, 2008 Share Posted June 5, 2008 (edited) Here is what you can do: expandcollapse popup;~ -------------------------------------------------------------------------------------------- ;~ Includes ;~ -------------------------------------------------------------------------------------------- #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ;~ -------------------------------------------------------------------------------------------- ;~ -------------------------------------------------------------------------------------------- ;~ Opções de Parametros/Funções ;~ -------------------------------------------------------------------------------------------- Opt("TrayMenuMode",1) ;~ -------------------------------------------------------------------------------------------- ;~ -------------------------------------------------------------------------------------------- ;~ Menu do SistemTray ;~ -------------------------------------------------------------------------------------------- $aboutitem = TrayCreateItem("About...") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() TraySetToolTip("Test") ;~ -------------------------------------------------------------------------------------------- ;~ -------------------------------------------------------------------------------------------- ;~ Funções do About... ;~ -------------------------------------------------------------------------------------------- Func About() #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("About", 324, 241, 303, 219, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS)) GUISetIcon("D:\006.ico") $GroupBox1 = GUICtrlCreateGroup("", 8, 8, 305, 185) $Image1 = GUICtrlCreatePic("", 16, 24, 105, 97) $Label1 = GUICtrlCreateLabel("Product Name", 152, 24, 72, 17, $WS_GROUP) $Label2 = GUICtrlCreateLabel("Version", 152, 48, 39, 17, $WS_GROUP) $Label4 = GUICtrlCreateLabel("Comments", 16, 160, 53, 17, $WS_GROUP) $Label3 = GUICtrlCreateLabel("Copyright", 16, 136, 48, 17, $WS_GROUP) GUICtrlCreateGroup("", -99, -99, 1, 1) $Button1 = GUICtrlCreateButton("&OK", 112, 208, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE GUIDelete("About") ExitLoop Case $Button1 GUIDelete("About") ExitLoop EndSwitch WEnd EndFunc ;~ -------------------------------------------------------------------------------------------- ;~ -------------------------------------------------------------------------------------------- ;~ While de Repetição dos comandos ;~ -------------------------------------------------------------------------------------------- While 1 $msgTray = TrayGetMsg() Select Case $msgTray = $aboutitem About() Case $msgTray = $exititem Exit EndSelect Sleep(50) WEnd ;~ -------------------------------------------------------------------------------------------- Regards EDIT: This is the one I'm talking about down under.. Edited June 5, 2008 by newbiescripter Link to comment Share on other sites More sharing options...
Darkbeo Posted June 5, 2008 Author Share Posted June 5, 2008 Just use this case like you do with the others: Case $button1 Exit Regards EDIT: Sorry i was too fast.. give me a little time then I'll post how to do. Exit will close the program... i need close only about windows... Link to comment Share on other sites More sharing options...
newbiescripter Posted June 5, 2008 Share Posted June 5, 2008 Exit will close the program... i need close only about windows...Yes. sorry I was a little to fast on that one.. But I've also posted a new solution above and that should works.Regards Link to comment Share on other sites More sharing options...
Darkbeo Posted June 5, 2008 Author Share Posted June 5, 2008 is exactly what i needed... Very Thanks newbiescripter 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