Article View: borland.public.cppbuilder.nativeapi
Article #4912Re: Windows End Session message
From: Remy Lebeau (TeamB)
Date: Sat, 12 Nov 2005 06:53
Date: Sat, 12 Nov 2005 06:53
41 lines
2255 bytes
2255 bytes
"Joanne" <jo.bullock@tiscali.co.uk> wrote in message
news:43747e60$1@newsgroups.borland.com...
> I was basing my code on an example in Borland help!
Borland's documentation is rarely accurate. You are better off using code
that has already been posted/demonstated here, in third-party articles, etc.
> I have declared the handler in my main form class as follows,
> (based on the same example):
Since you are using a MESSAGE_MAP, then the handler must call the base
form's Dispatch() method, not WndProc(). A MESSAGE_MAP is just a fancy
override of the Dispatch() method that expands to the following code during
compiling:
virtual void __fastcall Dispatch(void *message)
{
switch( ((TMessage*)message)->Msg )
{
case WM_ENDSESSION:
WMEndSession(*(TWMEndSession*)message);
break;
default:
TForm::Dispatch(message);
break;
}
}
Your handler shold look like this:
void __fastcall TForm1::WMEndSession(TWMEndSession &Message)
{
//...
TForm::Dispatch(&Message);
//...
}
Gambit
Technical Details
Message-ID:
<43759154$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!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:
<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: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <43732706$1@newsgroups.borland.com> <4373911d$1@newsgroups.borland.com> <43747e60$1@newsgroups.borland.com> Subject: Re: Windows End Session message Date: Fri, 11 Nov 2005 22:53:40 -0800 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 206.107.212.239 Message-ID: <43759154$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1131778388 206.107.212.239 (11 Nov 2005 22:53:08 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!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