🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Doubleclick

#16985
From: Remy Lebeau (TeamB)
Date: Sat, 12 Apr 2003 22:27
45 lines
2884 bytes
"CapStick" <lol@ljones81.fsnet.co.uk> wrote in message
news:3e98910e$1@newsgroups.borland.com...

> I am able to identify and get action from
> each control from its id

WM_COMMAND itself does not indicate mouse clicks.  In order to use
WM_COMMAND for anything meaningful, you must test it for specify
notification codes in the HIWORD(lParam).  You do not show your code doing
that at all.

However, as I said earlier, mouse clicks specifically do not use WM_COMMAND
to begin with, thus you are testing for the wrong message to begin with.
Not only that, but WM_COMMAND is sent to a given window's parent, not to the
window itself directly.  Unlike mouse messages such as WM_LBUTTONDBLCLICK,
which is sent to the window directly.  That is the message you should be
using for what you're asking for.  You're not currently doing that at all

> Am i missing the point here should i be carrying out
> some sort of hit test with mouse parameters

No, you should be using completely different messages to begin with.
WM_COMMAND is not the correct message to use for this situation.

> Because Just Putting
> case WM_LBUTTONDBLCLK
> is only recognised if i double click in
>  main window client area
> Not if i doubleclick in child windows

Correct, because it appears that you are catching messages on the main
window level, and WM_LBUTTONDBLCLICK messages are sent to the actual window
clicked on, not the parent window as with WM_COMMAND.  To catch the message
for a particular child window, you would have to catch the message at the
child window level instead.

> i only need one of my controls to accept a double click

All the more reason to use WM_LBUTTONDBLBLICK on the child window level
instead.  Subclass that particular child window directly, then you can
intercept WM_LBUTTONDBLBLICK directly for that child window itself.


Gambit
Technical Details
Message-ID: <3e9892c6$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!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3e9836ec@newsgroups.borland.com> <3e987243$1@newsgroups.borland.com> <3e98910e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,ed946abb1e9fc00b
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-04-12 15:36:19 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3e9836ec@newsgroups.borland.com> <3e987243$1@newsgroups.borland.com> <3e98910e$1@newsgroups.borland.com>
Subject: Re: Doubleclick
Date: Sat, 12 Apr 2003 15:27:45 -0700
Lines: 47
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: 207.175.226.26
Message-ID: <3e9892c6$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1050186438 207.175.226.26 (12 Apr 2003 15:27:18 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail