🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #14821

Re: Trapping button message - Thankyou!

#14821
From: Mattias Carleson
Date: Thu, 31 Jul 2003 07:09
33 lines
2138 bytes
Thankyou for your time. It works by now I have learned a lot about windows
messages.
See you later.
/Mattias

"Mattias Carleson" <mattias.carleson@home.se> skrev i meddelandet
news:3f26ea7c$1@newsgroups.borland.com...
>
> Hi!
> I want to trap the message generated by pressing a TSpeedButton.
> I�ve been trying it in the Application->OnMessage, and I�ve been trying it
by overriding the WndProc method. If Im right it�s the
> WM_COMMAND that should be trapped, but it doesnt seem to work.
> This is what I try to do:
>
> void __fastcall TMainForm::AppMessage(tagMSG &Msg, bool &Handled)
> {
>    if(Msg.message == WM_COMMAND)
>    {
>       if(HIWORD(Msg.wParam=BN_CLICKED))
>       {
>          ShowMessage("Button event catched!");
>       }
> }
>
> My second question is how to know which button object caused
> the message? I know LOWORD(Msg.wParam) should contain the
> identifier and that Msg.lParam contains the handle, but the
> TSpeedButton class and its parents doesnt seem to include any
> varible or function returning any of it.
>
> How should this be done? Thanks for your time.
> /Mattias
Technical Details
Message-ID: <3f28c028$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f26ea7c$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10cc67,77c37ce9ffa755d1
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-31 00:10:15 PST
From: "Mattias Carleson" <mattias.carleson@commentor.se>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f26ea7c$1@newsgroups.borland.com>
Subject: Re: Trapping button message - Thankyou!
Date: Thu, 31 Jul 2003 09:09:07 +0200
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 194.71.186.117
Message-ID: <3f28c028$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1059635240 194.71.186.117 (31 Jul 2003 00:07:20 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail