OnSetCursor由消息 WM_SETCURSOR 触发 The WM_SETCURSOR message is sent to a window if the mouse causes th
2014-04-08 18:07
453 查看
OnSetCursor由消息 WM_SETCURSOR 触发
The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured.
看清楚了,只要鼠标移动OnMouseMOve就会自动发送 WM_SETCURSOR从而触发OnSetCursor,因此在设计改变鼠标指针的程序时,一般不要在OnMouseMOve事件中调用SetCursor,容易引起指针闪烁。设置鼠标指针形状合理的方法是:
在OnMouseMove中使用一个变量记住各矩形crect中的鼠标形状,然后在OnSetCursor调用SetCursor设置鼠标
一
m_hCursor = LoadCursor(NULL,IDC_IBEAM);
SetCursor(m_hCursor);
………………
BOOL COpenGL_testView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
SetCursor(m_hCursor);
return TRUE;
}
OK!问题解决。
The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured.
看清楚了,只要鼠标移动OnMouseMOve就会自动发送 WM_SETCURSOR从而触发OnSetCursor,因此在设计改变鼠标指针的程序时,一般不要在OnMouseMOve事件中调用SetCursor,容易引起指针闪烁。设置鼠标指针形状合理的方法是:
在OnMouseMove中使用一个变量记住各矩形crect中的鼠标形状,然后在OnSetCursor调用SetCursor设置鼠标
一
m_hCursor = LoadCursor(NULL,IDC_IBEAM);
SetCursor(m_hCursor);
………………
BOOL COpenGL_testView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
SetCursor(m_hCursor);
return TRUE;
}
OK!问题解决。
http://5902977.blog.51cto.com/5892977/1016307
The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured.
看清楚了,只要鼠标移动OnMouseMOve就会自动发送 WM_SETCURSOR从而触发OnSetCursor,因此在设计改变鼠标指针的程序时,一般不要在OnMouseMOve事件中调用SetCursor,容易引起指针闪烁。设置鼠标指针形状合理的方法是:
在OnMouseMove中使用一个变量记住各矩形crect中的鼠标形状,然后在OnSetCursor调用SetCursor设置鼠标
一
m_hCursor = LoadCursor(NULL,IDC_IBEAM);
SetCursor(m_hCursor);
………………
BOOL COpenGL_testView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
SetCursor(m_hCursor);
return TRUE;
}
OK!问题解决。
The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured.
看清楚了,只要鼠标移动OnMouseMOve就会自动发送 WM_SETCURSOR从而触发OnSetCursor,因此在设计改变鼠标指针的程序时,一般不要在OnMouseMOve事件中调用SetCursor,容易引起指针闪烁。设置鼠标指针形状合理的方法是:
在OnMouseMove中使用一个变量记住各矩形crect中的鼠标形状,然后在OnSetCursor调用SetCursor设置鼠标
一
m_hCursor = LoadCursor(NULL,IDC_IBEAM);
SetCursor(m_hCursor);
………………
BOOL COpenGL_testView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
SetCursor(m_hCursor);
return TRUE;
}
OK!问题解决。
http://5902977.blog.51cto.com/5892977/1016307
相关文章推荐
- 错误编码 = 10022 错误消息 = SDK 组件 Qupaisdk 启动出错,错误消息为 [Qupaisdk], the android stack error message is Fail to start the plugin, which is caused by No implem
- There is no tracking information for the current branch.If you wish to set tracking information for
- SDK 组件 Qupaisdk 启动出错,错误消息为 [Qupaisdk], the android stack error message is Fail to start the plugin, which is caused by Failed resolution of: Lcom/duanqu/qupai/recorder/R$array;
- OnClick事件的Sender参数的前世今生——TWinControl.WinProc优先捕捉到鼠标消息,然后使用IsControlMouseMsg函数进行消息转发给图形子控件(意外发现OnClick是由WM_LBUTTONUP触发的)
- if the reference of the thread is set to null.
- startkde出现$DISPLAY is not set or cannot connect to the X server
- 30.In which situation may the UNDO_RETENTION parameter be ignored, even if it is set to a value?
- vs2005下出现“Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive”的解决方法
- 【Android】Do not requestWindow.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your th
- Warning: Attempt to present ControllerA and ControllerB whose view is not in the window hierarchy!
- 启动Dsedit报错:“Fail to initialize LIBTCL.DLL Please make sure the SYBASE environment variable is set co
- Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "te
- 遇到WARNING:Could not lower the asynch I/O limit to 170 for SQL direct I/O. It is set to -1
- How to check if the silverlight application is in design mode?
- Android How to Check if the App is in Background
- Failed to execute 'requestAnimationFrame' on 'Window': The callback provided as parameter 1 is not a
- php异常 Message: date(): It is not safe to rely on the system's timezone settings
- MySQL not using SSL the verifyServerCertificate property is set to 'false'
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- Warning: Attempt to present A on B whose view is not in the window hierarchy!