Ans: Many a times our application needs quite a long time to complete a particular task. For example, we may search for a file or browse the hard disk or sort a large number of items. At such times we can display an hourglass cursor to show that the application is busy doing the task. Following function shows how to display the hourglass cursor.
void CChildView::OnDisplay( )
{
BeginWaitCursor( )
// Perform the task
EndWaitCursor( )
}
The second technique to show the hourglass cursor is to create an object of class CWaitCursor. The constructor calls the BeginWaitCursor( ) function and destructor calls the EndWaitCursor( ) function respectively.