void CLesson9View::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CString str;
str.Format("x=%d, y=%d", point.x, point.y);//输出的同时将数据保存到了str中了?
// ((CMainFrame *)GetParent())->m_wndStatusBar.SetPaneText(0, str);//与下面的方法效果一样
((CMainFrame *)GetParent())->m_wndStatusBar.SetWindowText(str);
//系统是怎么知道在状态栏处输出坐标值的?这里我不太明白!
CView::OnMouseMove(nFlags, point);
}
这个函数就想在鼠标移动的过程中在状态栏中显示鼠标的坐标值,str.Format("x=%d, y=%d", point.x, point.y);是什么意思?输出坐标x,y?还是将point.x和 point.y放置到一个内存buffer(即str)中?
{
// TODO: Add your message handler code here and/or call default
CString str;
str.Format("x=%d, y=%d", point.x, point.y);//输出的同时将数据保存到了str中了?
// ((CMainFrame *)GetParent())->m_wndStatusBar.SetPaneText(0, str);//与下面的方法效果一样
((CMainFrame *)GetParent())->m_wndStatusBar.SetWindowText(str);
//系统是怎么知道在状态栏处输出坐标值的?这里我不太明白!
CView::OnMouseMove(nFlags, point);
}
这个函数就想在鼠标移动的过程中在状态栏中显示鼠标的坐标值,str.Format("x=%d, y=%d", point.x, point.y);是什么意思?输出坐标x,y?还是将point.x和 point.y放置到一个内存buffer(即str)中?
解决方案 »
- INNER JOIN 联合查询的问题
- 以前发过的,关于语音识别的,有新进展
- 多文档程序如何判断鼠标移动到滚动条上了?
- javascript 调用webbrowse事件
- 相同代码从SQL和Informix两种数据库读出中文的结果不一样?
- 我VC做的底层接口 怎样才能在JAVA上应用?
- 如果调用其它程序??在线等待
- 急问~~~如何得到文本输入框中的数据并且进行类型转换
- vc 上MFC不能运行,编译无错误,连接时一直等待。我刚开始学MFC,请教高手!
- Connection 的Execute与Recordset的Open以及Command的Execute有哪些差别
- WriteFile的问题
- listctrl不能显示!
这句话是得到父窗口的状态栏的指针后,将状态栏的字符刷成了str在Windows编程中,所有的控件都是窗口,都有句柄和指针
str.Format("x=%d, y=%d,z=%d", point.x, point.y,Z);的用法?
测试了一下,真是可以。不过,不知道到底能有多少个这样参数?a,b.,c,d,e,f,g,hi,j,……?
str.Format("x=%d, y=%d", point.x, point.y);是什么意思?
将鼠标的CPoint类型坐标值转换成CString类型的字符串,并保存在str中。