Solved

CListCtrl header click event

Posted on 2002-07-18
1
702 Views
Last Modified: 2013-11-20
How do i catch a mouse click event pressing the header
of a CListCtrl ?
I add the event to the code but, when pressing the table's header, there is no callback to the receiving function.
0
Comment
Question by:eliad
1 Comment
 
LVL 16

Accepted Solution

by:
imladris earned 100 total points
ID: 7162406
I ran into this problem. peterchen provided a solution along the following lines:

a) After adding a message handler, in the message map, you find something like:
ON_NOTIFY_REFLECT(HDN_ITEMCLICK, OnItemclick)

change this to two lines:
 ON_NOTIFY(HDN_ITEMCLICKA, 1, OnItemclick)
 ON_NOTIFY(HDN_ITEMCLICKW, 1, OnItemclick)

b) in OnInitialUpdate(), do
 GetListCtrl().GetHeaderCtrl()->SetDlgCtrlID(1);


To see the full discussion you can check the PAQ at:

http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=mfc&qid=20094826
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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 …
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

820 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