how to retrieve llist data from CListCtrl::OnNMRclick(NMHDR *pNMHDR, LRESULT *pResult)
-
hi, i want to know how i can get back the data from click event of the list control? i received a these 2 pointers, (NMHDR *pNMHDR, LRESULT *pResult). i think i need to have a typecast to get back my data. how can i get the position i click on the list so that i can get back my data from CListCtrl::GetItem() or CListCtrl::GetItemData()? any help? thanks?
-
hi, i want to know how i can get back the data from click event of the list control? i received a these 2 pointers, (NMHDR *pNMHDR, LRESULT *pResult). i think i need to have a typecast to get back my data. how can i get the position i click on the list so that i can get back my data from CListCtrl::GetItem() or CListCtrl::GetItemData()? any help? thanks?
You have to call HitTest() function to check which item of List Control is hit. After getting Handle to that item, you can do whatever you want. You can find Articles here on CodeProject for this. Sorry, I am too tired to search for those. You have to do it yourself.:zzz: Imagine that you are creating a fabric of human destiny with the object of making men happy in the end, giving them peace and rest at last, but that it was essential and inevitable to torture to death only one tiny creature..and to found that edifice on its unavenged tears, would you consent to be the architect on those conditions? Tell me, and tell me the truth! -Fyodor Dostoevsky, The Brothers Karamazov
-
You have to call HitTest() function to check which item of List Control is hit. After getting Handle to that item, you can do whatever you want. You can find Articles here on CodeProject for this. Sorry, I am too tired to search for those. You have to do it yourself.:zzz: Imagine that you are creating a fabric of human destiny with the object of making men happy in the end, giving them peace and rest at last, but that it was essential and inevitable to torture to death only one tiny creature..and to found that edifice on its unavenged tears, would you consent to be the architect on those conditions? Tell me, and tell me the truth! -Fyodor Dostoevsky, The Brothers Karamazov
Try casting to LPNMLISTVIEW: LPNMLISTVIEW p = (LPNMLISTVIEW) pNMHDR;
-
Try casting to LPNMLISTVIEW: LPNMLISTVIEW p = (LPNMLISTVIEW) pNMHDR;