getting selected row index
-
I have written an handler when the user presses the left mouse button in the list control. I am doing the following in the handler code { Invalidate(); HWND hWnd1 = ::GetDlgItem (m_hWnd,IDC_LIST2); LPNMITEMACTIVATE temp = (LPNMITEMACTIVATE) pNMHDR; RECT rect; //get the row number nItem = temp->iItem; .. .. .. } nItem is having -1 and not a valid row number? Could anyone tell why it is so. Thanks
-
I have written an handler when the user presses the left mouse button in the list control. I am doing the following in the handler code { Invalidate(); HWND hWnd1 = ::GetDlgItem (m_hWnd,IDC_LIST2); LPNMITEMACTIVATE temp = (LPNMITEMACTIVATE) pNMHDR; RECT rect; //get the row number nItem = temp->iItem; .. .. .. } nItem is having -1 and not a valid row number? Could anyone tell why it is so. Thanks
If you use MFC the GetSelectionMark() returns the zero-based selection mark, or -1 if there is no selection mark. I think your CListCtrl has to be in Report-mode. Arjan.