michcio Posted May 16, 2009 Share Posted May 16, 2009 hello there! I make a script which first creates a GUI and then closes it...then open another GUI and I use exactly the same method to close that GUI but it doesn't respond while closing by the "X" or my "Cancle" button.. here's the script for these two gui's: expandcollapse popup$width = 200 $height = 100 $win = GUICreate("Stäng av datorn",$width,$height,@DesktopWidth/2-$width/2,@DesktopHeight/2-$height/2) GUICtrlCreateLabel("Skriv in när datorn ska stängas av (min):",5,10,200,20) $min = GUICtrlCreateInput("",5,30,180,20,$ES_NUMBER) $OK = GUICtrlCreateButton("OK",5,60,80,20) $Cancle = GUICtrlCreateButton("Avbryt",95,60,80,20) GUISetState(@SW_SHOW) While true $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Or $msg = $Cancle Then $del = GUIDelete($win) Exit ElseIf $msg = $OK Then $min = GUICtrlRead($min) $del = GUIDelete($win) ExitLoop EndIf WEnd . . . GUICreate("Tid kvar",$width,$height,@DesktopWidth/2-$width/2,@DesktopHeight/2-$height/2) $Can = GUICtrlCreateButton("Avbryt",95,60,80,20) GUISetState(@SW_SHOW) While true $me= GUIGetMsg() If $me = $GUI_EVENT_CLOSE Or $me = $Can Then ExitLoop EndIf . . . thankfull for answers! michcio Link to comment Share on other sites More sharing options...
Valuater Posted May 16, 2009 Share Posted May 16, 2009 The entire code you posted has errors and won't run. How can we help you find the problem you stated if you script is full of errors? 8) Link to comment Share on other sites More sharing options...
martin Posted May 16, 2009 Share Posted May 16, 2009 hello there! I make a script which first creates a GUI and then closes it...then open another GUI and I use exactly the same method to close that GUI but it doesn't respond while closing by the "X" or my "Cancle" button.. here's the script for these two gui's: expandcollapse popup$width = 200 $height = 100 $win = GUICreate("Stäng av datorn",$width,$height,@DesktopWidth/2-$width/2,@DesktopHeight/2-$height/2) GUICtrlCreateLabel("Skriv in när datorn ska stängas av (min):",5,10,200,20) $min = GUICtrlCreateInput("",5,30,180,20,$ES_NUMBER) $OK = GUICtrlCreateButton("OK",5,60,80,20) $Cancle = GUICtrlCreateButton("Avbryt",95,60,80,20) GUISetState(@SW_SHOW) While true $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Or $msg = $Cancle Then $del = GUIDelete($win) Exit ElseIf $msg = $OK Then $min = GUICtrlRead($min) $del = GUIDelete($win) ExitLoop EndIf WEnd . . . GUICreate("Tid kvar",$width,$height,@DesktopWidth/2-$width/2,@DesktopHeight/2-$height/2) $Can = GUICtrlCreateButton("Avbryt",95,60,80,20) GUISetState(@SW_SHOW) While true $me= GUIGetMsg() If $me = $GUI_EVENT_CLOSE Or $me = $Can Then ExitLoop EndIf . . . thankfull for answers! michcioWorks ok for me. I can close the second gui with either the button or the red Gui close button. (After I add the missing Wend, missing #includes and remove the dots that is, so it would hav ebeen easier if you had posted a script we could run ) Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
michcio Posted May 16, 2009 Author Share Posted May 16, 2009 The entire code you posted has errors and won't run. How can we help you find the problem you stated if you script is full of errors?8)yeah I know I have only posted a part of it ... but solved my problem now ... the thing was that I paused the second while loop 1 sec every time and the GUI needs to be updated really fast all the time. Link to comment Share on other sites More sharing options...
oMBRa Posted May 16, 2009 Share Posted May 16, 2009 u dont need to do @DesktopWidth/2-$width/2 etc... just put ''-1'' as the helpfile says Link to comment Share on other sites More sharing options...
michcio Posted May 17, 2009 Author Share Posted May 17, 2009 u dont need to do @DesktopWidth/2-$width/2 etc... just put ''-1'' as the helpfile saysah nice missed that in the helpfile..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