tags:

views:

47

answers:

2

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.

A: 

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

MSalters
+2  A: 

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

Shrik
@Srhik: I would have thought that if a Cancel button is available then the mouse pointer shouldn't be an hourglass.
Craig Johnston