MFC:在状态栏最左边显示鼠标当前的坐标

时间:2023-01-21 19:16:09
在view里添加鼠标响应函数OnMouseMove即可:
void C xxx  View::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
CString str;
str.Format (_T("x=%d,y=%d"),point.x,point.y);
((CMainFrame *)GetParent())->SetMessageText (str);
CScrollView::OnMouseMove(nFlags, point);

}