Sign in to follow this  
Followers 0
nullschritt

Closing child process on exit.

4 posts in this topic

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.

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

$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]

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0