Prevent an application from being closed

Jan 3 2005 2:22 AM
I worked with CancelEventArgs and it was all i need until I realised that this way Windows is not always able to close the application when I shutdown or restart the computer. Could someone give me a solution?