Question

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?

Was it helpful?

Solution

I may be missing something but if your problem is distinguishing between the 2nd dialog being closed normally, and being closed using task manager, can you not set some kind of marker when the normal close action occurs, before closing? Logically then any close event where the marker has not been set will be down to the task manager?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top