VC:状态栏中显示鼠标位置

Posted on 2009-05-18 22:47 KELONG 阅读(250) 评论(0)  编辑 收藏 引用
转载自: http://www.songxiaolong.com

void CPointView::OnMouseMove(UINT nFlags, CPoint point) 
{
    
//状态栏中显示鼠标位置
    
//把CMainFrame内的m_wndStatusBar改成Public,然后View类中include它。
    CString str;
    str.Format(
"X=%d,Y=%d",point.x,point.y);
    ((CMainFrame
*)GetParent())->m_wndStatusBar.SetWindowText(str);
    CView::OnMouseMove(nFlags, point);
}

只有注册用户登录后才能发表评论。
网站导航:   博客园   博客园最新博文   博问   管理