Solved

WM_LBUTTONDOWN in Subclassed CHeaderCtrl

Posted on 2002-07-01
4
622 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

737 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