Article View: borland.public.cppbuilder.nativeapi
Article #2380Re: HELP: My app closes, but cancels Windows shutdown?
From: A Nonymous
Date: Thu, 08 Mar 2007 22:42
Date: Thu, 08 Mar 2007 22:42
48 lines
2686 bytes
2686 bytes
"Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote in news:45f08683$1
@newsgroups.borland.com:
>
> "A Nonymous" <anonymous@hotmail.com> wrote in message
> news:Xns98ED941B2E2C8anonymoushotmailcom@207.105.83.66...
>
>> My original code which has not changed in a LONG time and used to
> work
>> fine:
>
> Why don't you simply use the form's OnCloseQuery and OnClose events
> instead? The VCL already handles the WM_QUERYENDSESSION and
> WM_ENDSESSION messages. OnCloseQuery is triggered when
> WM_QUERYENDSESSION is received.
>
I just tried that. I commented out the message map line so as not to
interfeer with the normal processing of the end session messages. I
then modified the OnQueryClose to not ask about saving, just save and
exit.
Same problem.
I want the shutdown on Windows shutdown to be non interactive, just save
and close. If the user manually closes the app, then I want to ask if
they want to save modified files.
>> HWND H = FindWindow("TFormMain",NULL);
>
> Have you tried sending the message to the hidden TApplication window
> yet? That is the parent window for TForm, after all.
>
>
> Gambit
>
>
>
Not sure what you are asking about here. Is that the window that
windows is actually sending the WM_QUERYENDSESSION to? How do I get the
handle, TApplication doesn't seem to work. Even if I send to the hidden
form using my "fake" shutdown app and it returns false from the end
session messages, how do I isolate the source.
The goal is to identify what is causing the problem. If it is a
component I have the source for I will try to fix it. If it is one I
don't have the source for then I will contact the vendor for a patch, or
replace the component with something else.
Technical Details
Message-ID:
<Xns98EDAA07AFDF0anonymoushotmailcom@207.105.83.66>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<Xns98ED90968E734anonymoushotmailcom@207.105.83.66> <Xns98ED941B2E2C8anonymoushotmailcom@207.105.83.66> <45f08683$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,346f60f70c29a156 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: HELP: My app closes, but cancels Windows shutdown? From: A Nonymous <anonymous@hotmail.com> References: <Xns98ED90968E734anonymoushotmailcom@207.105.83.66> <Xns98ED941B2E2C8anonymoushotmailcom@207.105.83.66> <45f08683$1@newsgroups.borland.com> Message-ID: <Xns98EDAA07AFDF0anonymoushotmailcom@207.105.83.66> User-Agent: Xnews/5.04.25 NNTP-Posting-Host: 74.254.162.162 Date: 8 Mar 2007 14:42:18 -0800 X-Trace: newsgroups.borland.com 1173393738 74.254.162.162 (8 Mar 2007 14:42:18 -0800) Lines: 48 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail