Could anyone tell me how to ensure some code in my program gets executed when its process exits or gets killed?
The destroyer only gets called when it exits normally. But I want my code get executed when it's killed by a system shutdown or task manager.
The platform is Windows and I don't mind using platform specific code if it's needed.