Solved

WM_LBUTTONDOWN in Subclassed CHeaderCtrl

Posted on 2002-07-01
4
618 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 4

Expert Comment

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

Expert Comment

by:Melange
ID: 7122776
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
ID: 7123810
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
ID: 7129082
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

756 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