带有CheckBox的ListCtrl,当这个CheckBox改变状态后触发什么样的事件,不是那个一般的单击条目的事件我试验了

解决方案 »

  1.   

    在NM_CLICK消息中用CListCtrl::HitTest可以点到点击的地方是文字还是图标还是那个checkbox
    LVHT_ABOVE  The position is above the control's client area. 
    LVHT_BELOW  The position is below the control's client area. 
    LVHT_NOWHERE  The position is inside the list-view control's client window, but it is not over a list item. 
    LVHT_ONITEMICON  The position is over a list-view item's icon. 
    LVHT_ONITEMLABEL The position is over a list-view item's text. 
    LVHT_ONITEMSTATEICON The position is over the state image of a list-view item. 
    LVHT_TOLEFT  The position is to the left of the list-view control's client area. 
    LVHT_TORIGHT  The position is to the right of the list-view control's client area 
    如果是LVHT_ONITEMSTATEICON的话证明用户点击了那个checkbox,这时你可以检查该项的状态是选中还是没选中