Solved

CListCtrl header click event

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 77
difference between String.subString() and String.subSequence() 6 171
lucky13 challenge 11 122
NotAlone Challenge 20 79
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

920 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

15 Experts available now in Live!

Get 1:1 Help Now