Article View: borland.public.cppbuilder.nativeapi
Article #4911Re: Windows End Session message
From: JD
Date: Fri, 11 Nov 2005 21:49
Date: Fri, 11 Nov 2005 21:49
33 lines
2162 bytes
2162 bytes
"Joanne" <jo.bullock@tiscali.co.uk> wrote:
>
> [...] What should I now call from within WMEndSession? Or
> should I override WndProc?
To be clear, you can use a message map *or* override the
WndProc method. They are essentially the same (but they happen
at different times during the processing of the message). In
either case, you need to continue to process the message by
passing it onto the base class handler. For example:
//--- message map ---------------------------------------------
private:
typedef TForm inherited;
MESSAGE void __fastcall WMEndSession(TWMEndSession &Message);
public:
BEGIN_MESSAGE_MAP
VCL_MESSAGE_HANDLER(WM_ENDSESSION, TWMEndSession, MEndSession)
END_MESSAGE_MAP(TForm)
//-------------------------------------------------------------
MESSAGE void __fastcall TForm1::WMEndSession(TWMEndSession &Message)
{
// add your code here
inherited::Dispatch(&Message);
}
//-------------------------------------------------------------
I posted an example of overriding the form's WndProc method in
the vcl.using group in response to another post of yours.
~ JD
Technical Details
Message-ID:
<43751fed$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.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:
<43732706$1@newsgroups.borland.com> <4373911d$1@newsgroups.borland.com> <43747e60$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,e6c2b984611dcd0b X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "JD" <nospam@nospam.com> Sender: "JD" <nospam@nospam.com> Reply-To: "JD" <nospam@nospam.com> Subject: Re: Windows End Session message Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 152.163.100.131 X-Forwarded-For: 172.153.216.225 References: <43732706$1@newsgroups.borland.com> <4373911d$1@newsgroups.borland.com> <43747e60$1@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <43751fed$1@newsgroups.borland.com> Date: 11 Nov 2005 14:49:17 -0700 X-Trace: newsgroups.borland.com 1131749357 207.105.83.66 (11 Nov 2005 14:49:17 -0700) Lines: 35 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.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