让状态条响应鼠标事件

 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);
}

你可能感兴趣的:(function,Class)