LVN_COLUMNCLICK
-
I have a CListCtrl that is dynamically created. I am trying to add the columnclick event to it, but it doesn't seem to work. Any ideas why? this is what I am doing? Another question I have is how do you tell OnColumnClick which control you are refering to? I noticed that there are not IDs passed to it. in my .h I have this: //{{AFX_MSG(CFileView) ... afx_msg void OnColumnClick(NMHDR* pNMHDR, LRESULT* pResult); ... //}}AFX_MSG in my .cpp BEGIN_MESSAGE_MAP(CFileView, CListCtrl) //{{AFX_MSG_MAP(CDetailsView) ON_NOTIFY_REFLECT(NM_DBLCLK, OnDoubleClick) //}}AFX_MSG_MAP void CControllerSelection::OnColumnClick(NMHDR * pNMHDR, LRESULT * pResult) { NM_LISTVIEW * pNMListView = (NM_LISTVIEW*) pNMHDR; m_ControllerList.SortItems(CompareFunc, pNMListView->iSubItem); *pResult = 0; }
-
I have a CListCtrl that is dynamically created. I am trying to add the columnclick event to it, but it doesn't seem to work. Any ideas why? this is what I am doing? Another question I have is how do you tell OnColumnClick which control you are refering to? I noticed that there are not IDs passed to it. in my .h I have this: //{{AFX_MSG(CFileView) ... afx_msg void OnColumnClick(NMHDR* pNMHDR, LRESULT* pResult); ... //}}AFX_MSG in my .cpp BEGIN_MESSAGE_MAP(CFileView, CListCtrl) //{{AFX_MSG_MAP(CDetailsView) ON_NOTIFY_REFLECT(NM_DBLCLK, OnDoubleClick) //}}AFX_MSG_MAP void CControllerSelection::OnColumnClick(NMHDR * pNMHDR, LRESULT * pResult) { NM_LISTVIEW * pNMListView = (NM_LISTVIEW*) pNMHDR; m_ControllerList.SortItems(CompareFunc, pNMListView->iSubItem); *pResult = 0; }
First of all, decide if you're using CFileView, CControllerSelection or CDetailsView. Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.