How can I safe exit my application when the user terminates the application from the Control panel?

D

Dolphin White

Commonly, the application will receive the closing message when the user
terminates the application from control panel. But if a modal dialog of the
application has been opened, and the user tries to terminate the application
from the control panel, the application will have no response.

How can I solve this problem?



Thanks!
 
K

Katie Schaeffer [MSFT]

Hi Dolphin,

I was finally able to figure out what's going on here. So I'm assuming
you're talking about the 'Running Programs' list in the Memory section of
the control panel. It appears that the way this works is that a WM_CLOSE
is sent to the form selected when you click 'Stop'. Whether it displays
the 'Program not responding' dialog seems to be based upon whether the form
has been fully destroyed. So, our dialogs are reusable (by design) and
therefore are not normally destroyed when they are closed.
If you'd like to make your dialogs not cause this dialog bog to appear, you
can manually force them to be destroyed, by calling Form.Dispose after the
call to Form.ShowDialog. Keep in mind that if you just press 'Cancel'
rather then 'End Task', your program will continue on (it's not really not
responding).
Ideally, we'd like to see this Running Programs list not be form-based and
be process based instead. But this should at least clear up some
confusion.

-Katie

--------------------
| From: "Dolphin White" <[email protected]>
| Subject: How can I safe exit my application when the user terminates the
application from the Control panel?
| Date: Sat, 23 Aug 2003 00:57:24 +0800
| Lines: 13
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: 61.171.20.106
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:31736
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Commonly, the application will receive the closing message when the user
| terminates the application from control panel. But if a modal dialog of
the
| application has been opened, and the user tries to terminate the
application
| from the control panel, the application will have no response.
|
| How can I solve this problem?
|
|
|
| Thanks!
|
|
|
|

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top