Solved

CListCtrl header click event

Posted on 2002-07-18
1
663 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

18 Experts available now in Live!

Get 1:1 Help Now