怎样获取鼠标单击的点,当按下键盘的某个键都定位到该点 鼠标定位保存鼠标点 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 把OnLButtonDown的参数point(UINT nFlags, CPoint point) 保存起来,然后在OnKeyDown中SetCursorPos(point.x,point.y); 不知道用什么方法把point保存 在CEXAMPLEView类中添加一个成员变量 CPoint m_point;在OnLButtonDown函数中为其赋值m_point = point;然后在OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 函数中使用m_point不就可以了吗,还是我没看懂问题??? void CEXAMPLEView::OnLButtonDown(UINT nFlags, CPoint point) {// TODO: Add your message handler code here and/or call defaultCClientDC dc(this);dc.TextOut(point.x,point.y,"Hello",strlen("Hello"));m_Point=point;// 定义到 h 中 : CPoint m_PointCView::OnLButtonDown(nFlags, point);}void CEXAMPLEView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) {// TODO: Add your message handler code here and/or call defaultif (nChar=='m'||nChar=='M'){SetCursorPos(m_Point.x,m_Point.Y);}CView::OnKeyDown(nChar, nRepCnt, nFlags);} 想学习VC++,求前辈高手推荐一本入门级的教材或网络教程!谢谢~! 如何给对话框并其中所有的子控件重绘 惭愧啊!还是搞不出来,接着求助 【100分求助】一个简单的Dll线程问题(分不够可以再加) 如何读取 *.3ds 文件中 的 动画信息 急!!一个CFileDialog派生类的问题 急问!!Windows 的[默认声音]一般在什么情况下(什么消息)被激活!? 疑惑!!!(数据库问题) 请教:请问谁写过游戏杆校正程序. 【求助】vc调用DLL文件 刚下了VA_X_Setup1929文件发现提示的 WinMain 函数定义的不一样了 ON_MESSAGE 无效的类型转换
{
// TODO: Add your message handler code here and/or call default
CClientDC dc(this);
dc.TextOut(point.x,point.y,"Hello",strlen("Hello"));
m_Point=point;// 定义到 h 中 : CPoint m_Point
CView::OnLButtonDown(nFlags, point);
}void CEXAMPLEView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call defaultif (nChar=='m'||nChar=='M')
{
SetCursorPos(m_Point.x,m_Point.Y);
}
CView::OnKeyDown(nChar, nRepCnt, nFlags);
}