NM_SETFOCUS in ListCtrl
Posted on 2000-05-13
I use a ListCtrl in a dialog. I map the NM_SETFOCUS message like this:
void CMainDlg::OnSetfocusFilelist(NMHDR* pNMHDR, LRESULT* pResult)
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
int i = pNMListView->iItem;
*pResult = 0;
I think i is the item number that be set focus. But it can't work. I can't get the right number. why?
BTW, if I click a item to select it, can I still get the item's selected state after the control is not in the ListCtrl? I hope to click some items in the ListCtrl and press a button, then my program will know which items I have selected . what is the better way to implement this?
Thank you very much.