Article View: borland.public.cppbuilder.nativeapi
Article #4896Re: Windows shutdown not closing my app
From: Joseph F. Muscarella
Date: Thu, 10 Nov 2005 15:27
Date: Thu, 10 Nov 2005 15:27
48 lines
2266 bytes
2266 bytes
Vladimir,
Thanks for the reply. However, the WndProc() that I described was for a
custom component only. It is not for a form, let alone the main form. My
main form does not override the WndProc().
I only added the WM_QUERYENDSESSION message to the custom component's
WndProc as a test to see if that might be the problem.
A question about your code, though. Do you really want to do the cleanup
in both the WM_QUERYENDSESSION and the WM_ENDSESSION? Won't this result in
having your cleanup code execute twice?
Thanks again.
Joe
"Vladimir Stefanovic" <antivari@po.sbb.co.yu> wrote in message
news:437364bd@newsgroups.borland.com...
> > tried having this WndProc() trap the
> > WM_QUERYENDSESSION [...]
>
> Not only the WM_QUERYENDSESSION !
>
>
> This is the code that works fine for me:
>
> void __fastcall TDiMainForm::WndProc( TMessage &Message )
> {
> switch ( Message.Msg )
> {
> // ... other messages ...
>
> case WM_QUERYENDSESSION:
> case WM_ENDSESSION:
> YourCleanUpCodeHere();
> break;
>
> // ... other messages ...
> }
> TForm::WndProc( Msg );
> }
>
>
> --
> Best regards,
> Vladimir Stefanovic
>
>
Technical Details
Message-ID:
<437366b8@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!mpls-transit-01.news.qwest.net!63.218.45.11.MISMATCH!nx02.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<437354f8@newsgroups.borland.com> <437364bd@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6f884ae678fc34b6 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Joseph F. Muscarella" <joe@infosight-DISCARDMUNG-.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <437354f8@newsgroups.borland.com> <437364bd@newsgroups.borland.com> Subject: Re: Windows shutdown not closing my app Date: Thu, 10 Nov 2005 10:27:18 -0500 Lines: 50 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 NNTP-Posting-Host: 216.201.4.180 Message-ID: <437366b8@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1131636408 216.201.4.180 (10 Nov 2005 07:26:48 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!mpls-transit-01.news.qwest.net!63.218.45.11.MISMATCH!nx02.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail