Re:Mouse Clicks
"JD" <
XXXX@XXXXX.COM >wrote in message
Quote
I've overriden a controls WndProc where I'm listening for
mouse clicks because I want to add OnMouseDown,
OnMouseUp and OnDblClick events to the object.
Controls already do all of that for you. TControl already has such events,
and the necessary message handlings to trigger them. The only thing you
have to do yourself, if anything, is to promote the existing events from
protected to published.
Quote
My problem is that if I double click the object,
WM_LBUTTONUP is getting processed twice.
As it should. That is normal message processing on Windows' part, and is
clearly documented by Microsoft as such:
Only windows that have the CS_DBLCLKS style can receive WM_LBUTTONDBLCLK
messages, which Windows generates whenever the user presses, releases, and
again presses the left mouse button within the system's double-click time
limit. Double-clicking the left mouse button actually generates four
messages: WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, and WM_LBUTTONUP
again.
I've described this behavior before in terms of the VCL:
groups-beta.google.com/group/borland.public.cppbuilder.students/msg/24b79ce74eeaf310
Gambit
{smallsort}