BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if(pMsg->message == WM_LBUTTONDOWN && pMsg->hwnd == m_wndStatusBar.GetSafeHwnd())
{
CRect rect;
CPoint pt;
pt = pMsg->pt;
m_wndStatusBar.GetItemRect(2,&rect);
m_wndStatusBar.ClientToScreen(&rect);
if(PtInRect(&rect,pt))
//Add your function
}
return CFrameWnd::PreTranslateMessage(pMsg);
}
本文介绍了一个特定的WM_LBUTTONDOWN消息处理过程,在C++环境下针对状态栏点击事件进行响应判断。通过对鼠标左键点击事件的精确捕捉,实现特定区域内的交互逻辑。
1281

被折叠的 条评论
为什么被折叠?



