Windows 应用程序中的鼠标指针状态在鼠标移动之前不会改变
有没有人注意到,在 Windows 应用程序中,鼠标指针不会从沙漏状变为正常状态,除非您移动鼠标?
因此,即使您的应用程序已完成任务并且鼠标指针已设置为返回默认值,它也会保持沙漏状,直到您移动鼠标。 这是什么原因,可以解决吗?
我不确定其他人是否注意到了这一点,但这很奇怪,它可能是某种事件驱动的方式来保护操作系统资源。
Did anyone notice that in Windows applications the mouse pointer doesn't change from Hourglass back to normal until you move the mouse?
So even if your application has finished a task and the mouse pointer has been set to go back to default, it will stay as an hourglass until you move the mouse. What is the reason for this, and can be it resolved?
I'm not sure if other people have noticed this but it is quite strange and it might be some kind of event-driven way to conserve OS resources.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对话框应保持沙漏的逻辑。工作线程应该向对话框本身发送一条消息,告诉它开始维护沙漏线程。 (您可以通过在启动和停止沙漏的对话框中添加一个临时按钮来测试这一点。)
另一件事需要注意的是,让第二个进程设置第一个进程的沙漏是一件奇怪的事情。沙漏只会因用户操作而发生。当沙漏上升时,通常用户可以执行的唯一操作是“取消[使沙漏保持上升的任何操作]”。
The dialog box should maintain the logic of the hourglass. The worker thread should send a message to the dialog itself, telling it to start maintaining an hourglass thread. (You could test this by adding a temporary button to the dialog which starts and stops the hourglass.)
Another thing to be aware of is that having a second process set the hourglass of the first is an odd thing to do. An hourglass should only happen due to user action. While an hourglass is up, typically the only action that should be available to the user is "Cancel [whatever operation is keeping the hourglass up]."
能解决吗?在调用
SetCursor()
之前调用ShowCursor(FALSE)
,然后调用ShowCursor(TRUE)
。应该做这项工作。Can it be resolved? Call
ShowCursor(FALSE)
before you callSetCursor()
, andShowCursor(TRUE)
afterwards. Should do the job.