Responding To An Item Click In A List View
-
Hi, I need to know when an item is clicked in a ListView Control. And Which Items It is. I used the class wizzard to respond to the NM_Click Message. This gives me the following function header definition. void CResultsDlg::OnClickList(NMHDR* pNMHDR, LRESULT* pResult) How can i find out which item is clicked? Cheers Rich
-
Hi, I need to know when an item is clicked in a ListView Control. And Which Items It is. I used the class wizzard to respond to the NM_Click Message. This gives me the following function header definition. void CResultsDlg::OnClickList(NMHDR* pNMHDR, LRESULT* pResult) How can i find out which item is clicked? Cheers Rich
Try looking here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/CommCtls/ListView/Notifications/NM\_CLICK\_LISTVIEW.asp The key is to cast the pNMHDR to a NMITEMACTIVATE pointer and access the iItem and iSubItem members. Lee Nowotny