1

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.

2
  • If you're setting the mouse pointer back to Default (for example) it should change back virtually straight away. Have you got an example of where it does "stick"?
    – ChrisF
    Jul 1, 2010 at 9:33
  • @Chris: just do a google search and it will bring up a few examples. eg: bigresource.com/VB-Hourglass-stays-gxRMXlOAPZ.html
    – CJ7
    Jul 1, 2010 at 10:12

2 Answers 2

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

1
  • @Srhik: I would have thought that if a Cancel button is available then the mouse pointer shouldn't be an hourglass.
    – CJ7
    Jul 2, 2010 at 9:02
1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.