リストをコントロールするにはGetListCtrl()でポインタGETして操作
long count= 0,item = 0; CListCtrl &cList = m_pList->GetListCtrl(); item = cList.GetNextItem(-1, LVNI_ALL|LVNI_SELECTED); while ( item != -1 ){ CTarget *target = ( CTarget * )m_pList->GetItemData( item ); if( NULL != strstr(target->m_name , s_search_query) ){ break; } item = cList.GetNextItem(item,LVNI_ALL); } // カーソル移動 if( item != -1 ){ m_pList->SetItemState( item , LVIS_SELECTED | LVIS_FOCUSED , LVIS_SELECTED | LVIS_FOCUSED ); }
ネタ元