My program need to occupy some resources.
I want it to release those resources before exit. It\'s easy to achieve when the excutable exit normally.
However, what if the user
You cannot handle the scenario if user kill the application forcefully. But you don't have to worry about the resources. Windows will automatically free the resources acquired by your process when it is killed.