Solved

WM_LBUTTONDOWN in Subclassed CHeaderCtrl

Posted on 2002-07-01
4
608 Views
Last Modified: 2013-11-20
Hi,
I have subclassed the CHeaderCtrl in a CListCtrl.
Now I want to handle the "WM_LBUTTONDOWN" event but unfortunately I get about half calls then I actually pressed on the header (only if I press slowly I get all the pressing). I need to get all the LButtonDown events even if I press quickly.
Can someone please explain to me why this is happaning ?

BTW, I notice that it happans in all the list controls (even in the Explorer).

thanks,
Yoav.


0
Comment
Question by:yoavo
4 Comments
 
LVL 4

Expert Comment

by:mblat
Comment Utility
Try to get your messages in PreTranslateMessage() handler...
0
 
LVL 3

Expert Comment

by:Melange
Comment Utility
If you press quickly the second LBUTTONDOWN message will get converted to double clicks.

You have two choices:

1. Handle OnLButtonDblClk
2. Do what mblat suggested and override PreTranslateMessage to prevent the conversion to double clicks.
0
 

Author Comment

by:yoavo
Comment Utility
I tried to handle PreTranslateMessage, but this does not help... The events still coming "less than expected"...
0
 
LVL 8

Accepted Solution

by:
VinExpert earned 100 total points
Comment Utility
Hi Yoavo,

As Melange told, ur single LBUTTONDOWNs when pressed quickly will be converted into the DOUBLE CLICKS and will be routed to double click handler. If U want to check it, go to control panel -> Mouse. There change the double click speed to fastest possible. Then try it in that test area. Now, U will be getting all as single clicks!!!

I dont think it is possible to control it by overriding PreTranslateMessage as even that function also gets that message as the double click. There is a limit. U need to depend on that timing factor which mouse (driver) thinks that it as a single click or double click.

U can change that speed programatically by using SystemParametersInfo(...) function with SPI_SETDOUBLECLICKTIME action.

Try it out.
VinExpert
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Need a Shell script to start a service checking the port 6 46
iSeries FTP Exit Program 8 113
lucky13 challenge 11 111
haveThree challenge 22 100
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now