I have a list view control which at the moment only allows one item to be selected. I then read this via the following code:
void CApp::OnNMClickList1(NMHDR *pNMHDR, LRESULT *pResult) { int nSelected = (m_List.GetSelectionMark()); …
However, now I want to make this list able to multiselect, GetSelectionMark() always returns one index. Can anyone help me recode this to return a list of selected indexes?
Use
GetFirstSelectedItemPosition()to find first selected item, thenGetNextSelectedItem()for the rest and you’re done. 🙂