CListCtrl Checkbox被点击消息捕获

CListCtrl Checkbox被点击消息捕获


m_ListFIFOGroup.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_CHECKBOXES);

void CDlgFIFO::OnItemchangedListFifoGroup(NMHDR* pNMHDR, LRESULT* pResult)
{
 LPNMITEMACTIVATE   pNMLV   =   (LPNMITEMACTIVATE)pNMHDR;
 if((pNMLV->uOldState & INDEXTOSTATEIMAGEMASK(1)) /* old state : unchecked */
  && (pNMLV->uNewState & INDEXTOSTATEIMAGEMASK(2)) /* new state : checked */
  )
 {
  TRACE("Item %d is checked\n", pNMLV->iItem);
 }
 else if((pNMLV->uOldState & INDEXTOSTATEIMAGEMASK(2)) /* old state : checked */
  && (pNMLV->uNewState & INDEXTOSTATEIMAGEMASK(1)) /* new state : unchecked */
  )
 {
  TRACE("Item %d is unchecked\n", pNMLV->iItem);
 }
 else
 {
  TRACE("Item %d does't change the check-status\n", pNMLV->iItem);
 }
 *pResult = 0;
}

你可能感兴趣的:(CListCtrl Checkbox被点击消息捕获)