CListCtrl* pListCtrl = (CListCtrl*) GetDlgItem(IDC_YOURLISTCONTROL);
ASSERT(pListCtrl != NULL);
POSITION pos = pList->GetFirstSelectedItemPosition();
if (pos == NULL)
TRACE0("No items were selected!\n");
else
{
while (pos)
皮茄{
int nItem = pList->GetNextSelectedItem(pos);
巧搜 TRACE1("Item %d was selected!\n", nItem);
燃宽察 // you could do your own processing on nItem here
}
}
GetDlgItem(IDC_XX) 获虚大取控件指针差斗竖或销察句柄
int i=CListBox::GetCurSel();
CListBox::GetText(i)
CListCtrl::GetItemText(i);
GetDlgItem(IDC_XX),基类不同可能参数不同,返回HWND