用个循环,逐个去GetCheck; CListCtrl::GetCheck This method determines if an item in a list view control is selected. This should be used only for list view controls that have the LVS_EX_CHECKBOXES style.BOOL GetCheck( int nItem ) const; Parameters nItem The zero-based index of a list control item. Return Value Nonzero if the item is selected, otherwise, it is zero.Example // Pointer to the list view control. ClistCtrl* pmyListCtrl;int nCount = pmyListCtrl->GetItemCount(); BOOL fCheck = FALSE;// Set the check of every other item to TRUE and // all others to FALSE. for (int i=0;i < nCount;i++) { pmyListCtrl->SetCheck(i, fCheck); ASSERT((pmyListCtrl->GetCheck(i) && fCheck) || (!pmyListCtrl->GetCheck(i) && !fCheck)); fCheck = !fCheck; }
CListCtrl::GetCheck
This method determines if an item in a list view control is selected. This should be used only for list view controls that have the LVS_EX_CHECKBOXES style.BOOL GetCheck(
int nItem )
const;
Parameters
nItem
The zero-based index of a list control item.
Return Value
Nonzero if the item is selected, otherwise, it is zero.Example
// Pointer to the list view control.
ClistCtrl* pmyListCtrl;int nCount = pmyListCtrl->GetItemCount();
BOOL fCheck = FALSE;// Set the check of every other item to TRUE and
// all others to FALSE.
for (int i=0;i < nCount;i++)
{
pmyListCtrl->SetCheck(i, fCheck);
ASSERT((pmyListCtrl->GetCheck(i) && fCheck) ||
(!pmyListCtrl->GetCheck(i) && !fCheck));
fCheck = !fCheck;
}