다음을 통해 공유


CWaitCursor::Restore

대기 커서를 복원 하려면 메시지 상자 또는 대기 커서를 다른 커서 변경 대화 상자를 표시 하는 등의 작업을 수행한 후이 함수를 호출 합니다.

void Restore( );

설명

확인 호출 하는 것 복원 도 때 대기 커서가 현재 표시 됩니다.

함수 중 다른 하나는 대기 커서를 복원 하는 경우는 CWaitCursor 개체를 선언, 호출 수 CCmdTarget::RestoreWaitCursor.

예제

// This example illustrates performing an operation 
// which changes the wait cursor. You should call 
// CWaitCursor::Restore to restore the wait 
// cursor after an operation which changes the cursor.
void AnotherLengthyFunction( )
{
   CWaitCursor wait;   // display wait cursor

   // do some lengthy processing
   Sleep(1000);

   // The dialog box will normally change the cursor to
   // the standard arrow cursor.
   CFileDialog dlg(TRUE);
   dlg.DoModal();

   // It is necessary to call Restore here in order
   // to change the cursor back to the wait cursor.
   wait.Restore();

   // do some more lengthy processing
   Sleep(1000);

   // destructor automatically removes the wait cursor
}

// If the wait cursor is changed by a function called by
// the function which created the wait cursor, you 
// can call CCmdTarget::RestoreWaitCursor to restore 
// the wait cursor.
void CalledFunction()
{
   CFileDialog dlg(TRUE);
   dlg.DoModal();

   // Since CWinApp is derived from CCmdTarget, we can use a 
   // pointer to our application object to make the call to
   // CCmdTarget::RestoreWaitCursor.
   AfxGetApp()->RestoreWaitCursor();

   // Yet more lengthy processing...
   Sleep(1000);
}

요구 사항

헤더: afxwin.h

참고 항목

참조

CWaitCursor 클래스

계층 구조 차트

CCmdTarget::RestoreWaitCursor