To retrieve the index of the first selected item use GetNextItem(). As its name implies, you can use also use the GetNextItem() function to retrieve the index of the next selected item. The code below prints out the indices of all selected items to the debug window.
// This code prints out the indices of selected items to debug win int i = GetNextItem( -1, LVNI_ALL | LVNI_SELECTED); while( i != -1 ) { TRACE("%dn", i ); i = GetNextItem( i, LVNI_ALL | LVNI_SELECTED); }