Sign in to follow this  
Followers 0
atb

How do i properly shutdown my program when it gets killed

5 posts in this topic

I want to perform several cleanup actions, in the case my program ends.

Those cleanup actions should also be performed, when my program gets killed by e.g. taskkill (called without the /F force parameter).

I know from other languages, that there is a possibility to react on the "shutdown" message - i just can't find how to do this with autoit.

I found the windows event WM_QUERYENDSESSION, but this only applies to the shutdown of the complete machine.

Anybody any idea which Windows Event i have to register my program so that i can react on the "kill" of my program ?

Thanks in Advance,

ATB

Share this post


Link to post
Share on other sites



You could use a helper process that detects when the other process doesn't exists and then clean up the system.


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

You could use a helper process that detects when the other process doesn't exists and then clean up the system.

sure i could do that, but then i would have to run two processes and i just do not like that idea.

Share this post


Link to post
Share on other sites

And "OnExitFunc" doesn't apply to this?

Share this post


Link to post
Share on other sites

And "OnExitFunc" doesn't apply to this?

Thanks Mr.Zero - that's the keyword which helped me. It is not exactly what i needed, but i think i can work with that.

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