除非发生鼠标移动,否则Setcursor()不会生效 [英] Setcursor () does not take effect until a mouse move occurs

查看:699
本文介绍了除非发生鼠标移动,否则Setcursor()不会生效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在我的一个示例中,我正在从dll加载并设置游标.
但是在调用SetCursor()之后,光标不会立即重绘.
仅当发生鼠标移动时,才会显示新加载的光标.
有人可以帮我吗

Hi,
In one of my samples i am loading and setting a cursor from a dll.
But cursor is not redrawn immediately after calling SetCursor().
Newly loaded cursor will be shown only if a mouse move occurs.
Can any one help me

推荐答案

如果鼠标没有被捕获,则每次移动鼠标时,默认的窗口过程也会调用SetCursor 函数,并将其调回到用于注册windowclass的那个.

如果要重塑与窗口关联的光标,则必须调用 SetClassLong [ ^ ]并更改关联的光标.
The SetCursor function is also called by the default window procedure every time the mouse is moved if it is not captured, and set back to the one used to register the windowclass.

If you want the cursor associated to a window to reshape, you''ve to call SetClassLong [^]and change the associated cursor.


在刷新位于其上方的窗体或鼠标移动之前,光标不会被重绘.

坦白说,如果要从应该起作用的.DLL中设置鼠标光标,而不是从UI上进行设置,那么就从错误的位置设置了Cursor.
The cursor won''t get redrawn until the form that it''s sitting over gets refreshed or the mouse moves.

Frankly, if you''re setting the mouse cursor from a .DLL that is supposed to do work and not UI stuff, you''re setting the Cursor from the wrong place.


这篇关于除非发生鼠标移动,否则Setcursor()不会生效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆