I have a PocketPC C# application written in Visual Studio 2005. It uses nested forms (the user is presented with a form with multiple buttons, when the user selects one a new form is opened).
I've added code so that the 1st form sets it's title to string.Empty
to hide it from the Running Programs List. When the 2nd form is showing and the user uses the task manager to stop my app, the 2nd form gets the on close event.
Is there any way of knowing that the close event has come from the task manager so that I can close my application? At the moment when breakpointing the close event, I'm seeing the DialogResult being set as DialogResult.OK
(Which isn't helpful) and the 2nd dialog is closed returning control to caller which thinks the user selected OK and opens the next dialog.
I've Googled for info but all the helpful code such as ClosingEventArgs
aren't available in the compact framework. Any ideas?