让状态条响应鼠标事件

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


转:http://blog.csdn.net/fishion/article/details/3908542

你可能感兴趣的:(function)