16,502
社区成员
发帖
与我相关
我的任务
分享
if ((((LPNMHDR)lParam)->code == NM_RCLICK))
{
CPoint pt, pt2;
GetCursorPos(&pt);
pt2 = pt;
m_list.ScreenToClient(&pt);
CWnd* pWnd = m_list.ChildWindowFromPoint(pt);
CMFCHeaderCtrl pHeader = m_list.GetHeaderCtrl();
if(pWnd && (pWnd->GetSafeHwnd() == pHeader.GetSafeHwnd()))
{
HDHITTESTINFO info = {0};
info.pt = pt;
pHeader.SendMessage(HDM_HITTEST, 0, (LPARAM)&info);
CString str;
str.Format(_T("Column: %d clicked!"), info.iItem);
AfxMessageBox(str);
}
}
return CDialog::OnNotify(wParam, lParam, pResult);