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++环境下如何响应鼠标左键点击事件,并在状态栏特定区域触发自定义行为。通过获取鼠标点击位置并判断是否在预设区域内,实现了对状态栏特定部分的交互响应。
1263

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



