15,979
社区成员
发帖
与我相关
我的任务
分享
//判断鼠标点击的是否是图标,
//如果是:则退出;
CPoint mousePoint;
if (GetCursorPos(&mousePoint))
{
CRect icnRect;
if (m_list.GetSubItemRect(pNMListView->iItem, pNMListView->iSubItem, LVIR_ICON, icnRect)){
CPoint icnLTpoint(icnRect.left, icnRect.top);
::ClientToScreen(m_list.m_hWnd, &icnLTpoint);
icnRect.left = icnLTpoint.x;
icnRect.top = icnLTpoint.y;
icnLTpoint = icnRect.BottomRight();
::ClientToScreen(m_list.m_hWnd, &icnLTpoint);
icnRect.right = icnLTpoint.x;
icnRect.bottom = icnLTpoint.y;
if (icnRect.PtInRect(mousePoint)){
return;
}
}
}
BOOL CMainFrame::PreTranslateMessage(MSG* lpMsg)
{
if (lpMsg->message == WM_LBUTTONDBLCLK)
int xPos = LOWORD(lpMsg->lParam); // 鼠标双击位置
int yPos = HIWORD(lpMsg->lParam);
m_wndStatusBar.GetItemRect(0, &(rc));
CPoint pt(xPos, yPos);
ClientToScreen(&rc);
ClientToScreen(&pt);
if (PtInRect(&rc, pt))
}