πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Trapping button message

#14893
From: Remy Lebeau (TeamB)
Date: Tue, 29 Jul 2003 22:11
35 lines
2298 bytes
"Mattias Carleson" <mattias.carleson@home.se> wrote in message
news:3f26ea7c$1@newsgroups.borland.com...

> I want to trap the message generated by pressing a TSpeedButton.

TSpeedButton is a TGraphicControl descendant.  It is not a true button, thus
does not response to actual button messages.  Its clicking operations are
based on mouse Up/Down events directly.

> If Im right itοΏ½s the WM_COMMAND that should be
> trapped, but it doesnt seem to work.

WM_COMMAND only applies to windowed controls, which TSpeedButton is not.
What you are attempting to do would apply for TButton or TBitBtn, but not
TSpeedButton.

> My second question is how to know which button object
> caused the message?

You wouldn't.

> 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.

When a windowed parent receives WM_COMMAND, WM_NOTIFY, etc. on behalf of a
child window, it determines the necessary handle from the message and then
passes that handle to its FindControl() method.  If a child control matching
that handle is found, the message is then forwarded to that control for
processing.


Gambit
Technical Details
Message-ID: <3f26efb2$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!yellow.newsread.com!netaxs.com!newsread.com!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-29 15:10:27 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f26ea7c$1@newsgroups.borland.com>
Subject: Re: Trapping button message
Date: Tue, 29 Jul 2003 15:11:31 -0700
Lines: 37
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 207.175.226.26
Message-ID: <3f26efb2$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1059516338 207.175.226.26 (29 Jul 2003 15:05:38 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!yellow.newsread.com!netaxs.com!newsread.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail