nullschritt Posted July 25, 2013 Share Posted July 25, 2013 Hello all, I have a (probably) simple question. For some reason my application is not automatically closing the child process I launch from it(in a simple test program it closes the child process automatically, but in my larger application, it for some reason does not), how would I go about making sure that the child process is automatically closed when the main process exits? It's been quite a bit since I've coded with autoit, but if I recall correctly, there used to be an "onexit" command, which I cannot locate in the help file, I assume there is a new way of doing this, or I am just remembering incorrectly? Anyways, thanks for reading my post, hope I can get an answer for this problem. Link to comment Share on other sites More sharing options...
Solution kylomas Posted July 25, 2013 Solution Share Posted July 25, 2013 nullschrift, There is a "OnAutoItExitRegister" command that allows you to specify a function that will run when the script exits. You can also determine the reason for exit. See the Help file. kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Edano Posted July 25, 2013 Share Posted July 25, 2013 $PID=Run("Childprocess") . . . Func _Exit() While ProcessExists($PID) ProcesClose($PID) Wend Exit Endfunc [color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font] Link to comment Share on other sites More sharing options...
nullschritt Posted July 25, 2013 Author Share Posted July 25, 2013 nullschrift, There is a "OnAutoItExitRegister" command that allows you to specify a function that will run when the script exits. You can also determine the reason for exit. See the Help file. kylomas Thanks, this is what I was looking for! 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