Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,

My intention of implementing a hourglass(wait cursor) is to do some lengthy process.
And this has to be implemented in a property sheet .I am having a property sheet with three pages,in the second page when i click next i must show or activate this hourglass there for sometime ,so that even though we play around the Next,Back and Cancel button's on the property sheet it should respond.I am able to produce or activate that wait cursor ,But problem is during that wait cursor time we are able visualize the spinning wheel on the page but if i had a click on the next button then dialog is getting dismissed after sleep time is over.What i noticed is the immediate page consists of finish so that is why it is getting dismissed.

In the page OnWizardNext() I implemented it as follows,

CWaitCursor waitobj;

sleep(10000);

return CPropertyPage::OnWizardNext();



For this I am able to get the wait cursor but if click on the next button it is getting dismissed ,Any event should not get triggered during that wait cursor if i click on any part of the UI nothing should get done .

Can anyone please let me know how can i achieve this.


Thanks in advance
Posted

1 solution

To use the CWaitCursor class to show a wait cursor, an instance of the object is simply created. Destroying the object restores the normal cursor. However, the documentation states that although the lifetime of the object may span messages, the wait cursor is only guaranteed to remain on the screen for the duration of the currently processing message.

The purpose of this article is to describe a simple and neat method of allowing the wait cursor to persist across messages.



Take a look at this example: A Persistent Wait Cursor[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900