AzKay Posted July 17, 2006 Share Posted July 17, 2006 Whats the code for the script to close, when the "x" in the top right of the gui is pressed? Mine doesnt seem to be included when I generate the code for the gui. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Helge Posted July 17, 2006 Share Posted July 17, 2006 $msg = GUIGetMsg() If $msg =$GUI_EVENT_CLOSE Then Exit Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 17, 2006 Moderators Share Posted July 17, 2006 If your using GUIGetMsg() then it would be something like: $Msg = GUIGetMsg() If $Msg = -3 Then Exit; or $GUI_EVENT_CLOSE Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
AzKay Posted July 17, 2006 Author Share Posted July 17, 2006 Tryed both, non worked Oo # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
rambo3889 Posted July 17, 2006 Share Posted July 17, 2006 (edited) This should work= ;setup the gui #include <GUIconstants.au3> Guicreate("My gui") Guisetstate() While 1 $msg = guigetmsg() If $msg = $GUI_EVENT_CLOSE THen exit wend Edited July 17, 2006 by rambo3889 My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youre the best in town Fight! Link to comment Share on other sites More sharing options...
AzKay Posted July 17, 2006 Author Share Posted July 17, 2006 Still doesnt work # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
rambo3889 Posted July 17, 2006 Share Posted July 17, 2006 WTF?? I just tested and it worked fine My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youre the best in town Fight! Link to comment Share on other sites More sharing options...
Helge Posted July 17, 2006 Share Posted July 17, 2006 (edited) Save rambo's code as a script and it will work... don't copy it into your own script. If it's still doesn't work, then please tell us what you mean ? What happens ? Is it an error-message ? What version of AutoIt are you running ? Edited July 17, 2006 by Helge Link to comment Share on other sites More sharing options...
AzKay Posted July 17, 2006 Author Share Posted July 17, 2006 #include <GUIConstants.au3> #include <IE.au3> Opt("GUIOnEventMode", 1) ### Koda GUI section start ### $YouTubeUpload = GUICreate("YouTubeUpload", 284, 220, 190, 117) $UserName = GUICtrlCreateInput("Username", 0, 0, 281, 21) $o_IE = ObjCreate("Shell.Explorer.2") $o_IE_ctrl = GUICtrlCreateObj($o_IE, 0, 176, 74, 92) GUICtrlSetState(-1, $GUI_HIDE) $PassWord = GUICtrlCreateInput("Password", 0, 24, 281, 21) $Title = GUICtrlCreateInput("Title", 0, 48, 281, 21) $Description = GUICtrlCreateInput("Description", 0, 72, 281, 21) $Tags = GUICtrlCreateInput("Tags", 0, 96, 281, 21) $Private = GUICtrlCreateRadio("Private", 80, 152, 65, 17) $Public = GUICtrlCreateRadio("Public", 8, 152, 65, 17) $File = GUICtrlCreateInput("File", 0, 120, 281, 21) $Upload = GUICtrlCreateButton("Upload", 152, 144, 129, 33, 0) GUICtrlSetOnEvent(-1, "UploadClick") $Load = GUICtrlCreateLabel("...", 112, 190, 61, 17, $SS_CENTER) GUISetState(@SW_SHOW) ### Koda GUI section end ### While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit Sleep(100) WEnd Func UploadClick() GUICtrlSetData($Load, "Uploading") GUICtrlSetState($Upload, $GUI_DISABLE) EndFunc Doesnt work for me >< # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Helge Posted July 17, 2006 Share Posted July 17, 2006 Put this just before you while-loop : GUISetOnEvent($GUI_EVENT_CLOSE, "quit")oÝ÷ ÚØ^¶¬jÛayéÝ¡ü¨º»®*mjëh×6Func Quit() Exit EndFunc Link to comment Share on other sites More sharing options...
rambo3889 Posted July 17, 2006 Share Posted July 17, 2006 #include <GUIConstants.au3> ;~ #include <IE.au3> ;~ ### Koda GUI section start ### $YouTubeUpload = GUICreate("YouTubeUpload", 284, 220, 190, 117) $UserName = GUICtrlCreateInput("Username", 0, 0, 281, 21) $o_IE = ObjCreate("Shell.Explorer.2") $o_IE_ctrl = GUICtrlCreateObj($o_IE, 0, 176, 74, 92) GUICtrlSetState(-1, $GUI_HIDE) $PassWord = GUICtrlCreateInput("Password", 0, 24, 281, 21) $Title = GUICtrlCreateInput("Title", 0, 48, 281, 21) $Description = GUICtrlCreateInput("Description", 0, 72, 281, 21) $Tags = GUICtrlCreateInput("Tags", 0, 96, 281, 21) $Private = GUICtrlCreateRadio("Private", 80, 152, 65, 17) $Public = GUICtrlCreateRadio("Public", 8, 152, 65, 17) $File = GUICtrlCreateInput("File", 0, 120, 281, 21) $Upload = GUICtrlCreateButton("Upload", 152, 144, 129, 33, 0) $Load = GUICtrlCreateLabel("...", 112, 190, 61, 17, $SS_CENTER) GUISetState() ;~ ### Koda GUI section end ### While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit ;~ Sleep(100) If $msg = $Upload Then UploadClick() WEnd Func UploadClick() GUICtrlSetData($Load, "Uploading") GUICtrlSetState($Upload, $GUI_DISABLE) EndFunc You were using event and if My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youre the best in town Fight! Link to comment Share on other sites More sharing options...
rambo3889 Posted July 17, 2006 Share Posted July 17, 2006 Damn helge you were to fast 4 me My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youre the best in town Fight! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 17, 2006 Moderators Share Posted July 17, 2006 You CAN'T use GUIGetMsg() with GUIOnEventMode!!! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
AzKay Posted July 17, 2006 Author Share Posted July 17, 2006 Put this just before you while-loop : GUISetOnEvent($GUI_EVENT_CLOSE, "quit")oÝ÷ ÚØ^¶¬jÛayéÝ¡ü¨º»®*mjëh×6Func Quit() Exit EndFuncThanks. # MY LOVE FOR YOU... IS LIKE A TRUCK- # 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