3个回答
展开全部
当鼠标在程序窗口中移动时,程序会收到WM_MOUSEMOVE消息。即:OnMove函数会被调用(是调用时机由系统决定)。你要做的是决定在函数中做什么事情(即:OnMove函数的实现由你完成。
希望这么说你能明白。如果不明白来QQ群139892312找我。注意:群规很严,不是真心想学习就不要加了。避免被T。
希望这么说你能明白。如果不明白来QQ群139892312找我。注意:群规很严,不是真心想学习就不要加了。避免被T。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
给你msdn上的解释~
CWnd::OnMove
afx_msg void OnMove( int x, int y );
Parameters
x
Specifies the new x-coordinate location of the upper-left corner of the client area. This new location is given in screen coordinates for overlapped and pop-up windows, and parent-client coordinates for child windows.
y
Specifies the new y-coordinate location of the upper-left corner of the client area. This new location is given in screen coordinates for overlapped and pop-up windows, and parent-client coordinates for child windows.
Remarks
The framework calls this member function after the CWnd object has been moved.
Note This member function is called by the framework to allow your application to handle a Windows message. The parameters passed to your function reflect the parameters received by the framework when the message was received. If you call the base-class implementation of this function, that implementation will use the parameters originally passed with the message and not the parameters you supply to the function.
CWnd::OnMove
afx_msg void OnMove( int x, int y );
Parameters
x
Specifies the new x-coordinate location of the upper-left corner of the client area. This new location is given in screen coordinates for overlapped and pop-up windows, and parent-client coordinates for child windows.
y
Specifies the new y-coordinate location of the upper-left corner of the client area. This new location is given in screen coordinates for overlapped and pop-up windows, and parent-client coordinates for child windows.
Remarks
The framework calls this member function after the CWnd object has been moved.
Note This member function is called by the framework to allow your application to handle a Windows message. The parameters passed to your function reflect the parameters received by the framework when the message was received. If you call the base-class implementation of this function, that implementation will use the parameters originally passed with the message and not the parameters you supply to the function.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
楼上显然把OnMove()和OnMouseMove()混淆了。
理论上OnMove()这个函数是在移动窗口的时候用的 但是一般编写程序的时候不会对用户移动窗口做出响应吧。
如果你想要在改变窗口大小的时候做出响应应该重载OnSize()
不过最好的方法是都不要重载 直接在OnDraw()里编写
理论上OnMove()这个函数是在移动窗口的时候用的 但是一般编写程序的时候不会对用户移动窗口做出响应吧。
如果你想要在改变窗口大小的时候做出响应应该重载OnSize()
不过最好的方法是都不要重载 直接在OnDraw()里编写
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询