1、在String Table中设置语句的ID。2、在CMainFrame下的indicator数组中添加项:static UINT indicators[] ={ ID_SEPARATOR, // status line indicator ID_MOUSE, ID_INDICATOR_CAPS, ID_INDICATOR_NUM, ID_INDICATOR_SCRL,};3、实例:void CTestView::OnMouseMove(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default CString str; str.Format("当前鼠标位置:%d,%d",point.x,point.y); CMainFrame *pmain=(CMainFrame*)AfxGetMainWnd(); CStatusBar *pstatusbar=(CStatusBar*)pmain->GetDescendantWindow(AFX_IDW_STATUS_BAR); pstatusbar->SetPaneInfo(1,ID_MOUSE,SBPS_POPOUT,150); pstatusbar->SetPaneText(1,str);; CView::OnMouseMove(nFlags, point);}
转载于:https://www.cnblogs.com/shenchao/archive/2012/10/24/2737777.html