Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick Question about CListCtrl

Status
Not open for further replies.

Valius

Programmer
Oct 20, 2000
174
US
I noticed this class has a handler for when the column heading is clicked. Well, I have a program that has 3 different headings and I want to sort these based on which heading I clicked. I noticed that the "OnColumnclickxxx" function has two parameters and I thought that maybe one of these parameters holds the value for which heading was clicked, but it doesn't seem like they do. My main question is HOW can I tell WHICH column heading was clicked? Any and all info is greatly appreciated. Thanks in advance!

Niky Williams
NTS Marketing
 
I think that you might need to cast the first parameter to an NMLISTVIEW pointer and then access the iSubItem member of that structure. For example,

void CSomeDialogClass::OnColumnclickSomeList( NMHDR* pNMHDR, LRESULT* pResult )
{
NMLISTVIEW* pNMListView = (NMLISTVIEW*)pNMHDR;
int nColClicked = pNMListView->iSubItem;

// use nColClicked here...
}
 
Cool, I'll look into this. Thanks for the info!!

Niky Williams
NTS Marketing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top