MFC treecontrol 复选框问题 怎么判断点击的是文字还是文字前面的复选框?
void CQ700626Dlg::OnClickTree1(NMHDR *pNMHDR, LRESULT *pResult)
{
// TODO: Add your control notification handler code here
NM_TREEVIEW* pHdr = (NM_TREEVIEW*)pNMHDR;
*pResult = 0;
CPoint point;
UINT uFlag;
GetCursorPos(&point);
ScreenToClient(&point);
HTREEITEM item = m_tree.HitTest(point, &uFlag);
if (point.x > 30)
MessageBox(_T("click the text"), NULL, 0U);
else
MessageBox(_T("click the box"), NULL, 0U);
*pResult = 0;
}