gcue Posted March 26, 2010 Share Posted March 26, 2010 how can i force a script to wait until a gui is closed before continuing? If FileExists($aDIR & "assets.ini.bak1") Then MsgBox(262144, "", "Your config is missing but at least 1 backup copy was found. Please chose a config to restore from.") ViewBackups_GUI() ;what can i put here to make the script wait until ViewBackups_GUI is closed? EndIf thanks! Link to comment Share on other sites More sharing options...
JohnOne Posted March 26, 2010 Share Posted March 26, 2010 While 1 Sleep(10) If Not WinExists("ViewBackups_GUI") Then ExitLoop EndIf WEnd Exit Is one way AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
GodlessSinner Posted March 26, 2010 Share Posted March 26, 2010 (edited) WinWait() or example listed above.. or add a Global $var = 0, which changes when ViewBackups_GUI closes and check it in: While $var = 0 sleep(100) Wend Edited March 26, 2010 by GodlessSinner _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
martin Posted March 26, 2010 Share Posted March 26, 2010 how can i force a script to wait until a gui is closed before continuing? If FileExists($aDIR & "assets.ini.bak1") Then MsgBox(262144, "", "Your config is missing but at least 1 backup copy was found. Please chose a config to restore from.") ViewBackups_GUI() ;what can i put here to make the script wait until ViewBackups_GUI is closed? EndIf thanks! I doubt you can put anything there to wait until ViewBackups_Gui is closed. It depends of course on what the function does. If it creates a gui and waits for a response then the function should close the gui before returning so nothing else is needed. You might want to disable to main gui before the function is called and enable it afterwards though. Buit anything like the suggestions before which don't handle events from the gui you are waiting to be closed will just wait forever. Or maybe I guessed wrongly what th efunction does. 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...
JohnOne Posted March 26, 2010 Share Posted March 26, 2010 You're right. Its easy how one phrase can change the whole meaning of something Is closed and closes mean totally different things and would need to be handled in a different fashion. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
gcue Posted March 26, 2010 Author Share Posted March 26, 2010 actually this worked $var = False ViewBackups_GUI() While $var = False If WinExists("Restore Assets List") Then Sleep(10) Else Exit EndIf WEnd i do wait for a response, but the response exits the main script anyway no response (they close viewbackups_gui) exits the script too =) so it works out! thank you very much for your help =) have a good weekend fellas. Link to comment Share on other sites More sharing options...
GodlessSinner Posted March 26, 2010 Share Posted March 26, 2010 (edited) Global $var ViewBackups_GUI(); inside func set $var to False, OnCloseGUI - to True While $var = False If WinExists("Restore Assets List") Then; Not optimal, you already using variable for this. Sleep(10) Else Exit EndIf WEnd Edited March 26, 2010 by GodlessSinner _____________________________________________________________________________ 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