Re: how to differentiate a single click from a double click in CTreeviewCtrl
- From: "David Webber" <dave@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 29 Sep 2007 00:10:24 +0100
"JD" <jdt_young@xxxxxxxxx> wrote in message news:%23ItBLxhAIHA.536@xxxxxxxxxxxxxxxxxxxxxxx
In CTreeviewCtrl, I want to catch both the double click and the single click events, but also need to differentiate them. For the double click event, a handle is written against WM_LBUTTONDBLCLK. But against what message should I write for single click event? I tried WM_LBUTTONDOWN. But WM_LBUTTONDOWN will be fired too if I double click an item. Basically, I want to differentiate single and double click events. Is there a way? Thanks for any help.
The standard model in Windows is that a single click selects something, and that a double click does something to the selected item.
Thus the response to a double click can rely on the fact that the appropriate item has been selected by a single click.
If you want to do something with a single click which is not compatible with it being the first half of a double click, then you will probably confuse the users of your program, and I'd urge you to think of another way (eg with the right mouse button or the keyboard).
If you really really want to do it, you could probably do something like setting timer and responding to the single click when the timer expires only if no double click has been received by then - but it is ugly.
Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm
.
- Follow-Ups:
- References:
- Prev by Date: Sorry...
- Next by Date: Re: WindowsXP Explorer selection highlight - how is it done?
- Previous by thread: how to differentiate a single click from a double click in CTreeviewCtrl
- Next by thread: Re: how to differentiate a single click from a double click in CTreeviewCtrl
- Index(es):
Loading