Windows 应用程序中的鼠标指针状态在鼠标移动之前不会改变

发布于 2024-09-08 10:41:49 字数 200 浏览 0 评论 0原文

有没有人注意到,在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

时光磨忆 2024-09-15 10:41:49

对话框应保持沙漏的逻辑。工作线程应该向对话框本身发送一条消息,告诉它开始维护沙漏线程。 (您可以通过在启动和停止沙漏的对话框中添加一个临时按钮来测试这一点。)

另一件事需要注意的是,让第二个进程设置第一个进程的沙漏是一件奇怪的事情。沙漏只会因用户操作而发生。当沙漏上升时,通常用户可以执行的唯一操作是“取消[使沙漏保持上升的任何操作]”。

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]."

且行且努力 2024-09-15 10:41:49

能解决吗?在调用 SetCursor() 之前调用 ShowCursor(FALSE),然后调用 ShowCursor(TRUE)。应该做这项工作。

Can it be resolved? Call ShowCursor(FALSE) before you call SetCursor(), and ShowCursor(TRUE) afterwards. Should do the job.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文