Article View: borland.public.cppbuilder.nativeapi
Article #7609Re: Terminating process in case of emergency
From: Remy Lebeau (TeamB)
Date: Sat, 15 Jan 2005 01:04
Date: Sat, 15 Jan 2005 01:04
24 lines
1962 bytes
1962 bytes
"Michael Wade" <noway@nohow.com> wrote in message news:snmgu0tiunp5m429d0s7ldakkrt9vshkvv@4ax.com... > I don't want to send a WM_QUIT message as I am > not entirely sure of the state of the program. That is, however, exactly what you should be doing. It is the most elegant way to ask the process to terminate itself in a graceful manner. It doesn't really matter what state the process is in, it should still clean up its own resources when it does terminate. WM_CLOSE would be even more elegant, however applictions can choose to ignore WM_CLOSE. Perhaps using WM_QUERYENDSESSION and WM_ENDSESSION would be good to use to simulate a system shutdown. Except that applications are allowed to prevent shutdowns when receiving WM_QUERYENDSESSION. > Is TerminateProcess the one I want? That is a brute-force termination that should be avoided at all costs, as it will not allow the process to clean up after itself, or unload any loaded DLLs. Gambit
Technical Details
Message-ID:
<41e86bb8$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<snmgu0tiunp5m429d0s7ldakkrt9vshkvv@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,18b55384e6e9f2be X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <snmgu0tiunp5m429d0s7ldakkrt9vshkvv@4ax.com> Subject: Re: Terminating process in case of emergency Date: Fri, 14 Jan 2005 17:04:49 -0800 Lines: 26 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <41e86bb8$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1105750968 68.69.17.41 (14 Jan 2005 17:02:48 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail