CCmdTarget::BeginWaitCursor

void BeginWaitCursor ( );

ÁÖÀÇ

¸í·ÉÀ» ½ÇÇà ÇÏ·Á¸é ´«¿¡ ¶ç´Â ½Ã°£ °£°ÝÀ»°¡Áö°í ±â´ë ÇÏ´Â °æ¿ì Ä¿¼­¸¦ ¸ð·¡ ½Ã°è ¸ð¾çÀ¸·Î Ç¥½Ã ÇÏ·Á¸éÀÌ ÇÔ¼ö¸¦ È£Ãâ ÇÕ´Ï´Ù. ±×°ÍÀº ¶§ CDocument °³Ã¼ ·Îµå ¶Ç´Â ÆÄÀÏ ÀÚü¿¡ ÀúÀå ÇÏ´Â µî ¹Ù»Û »ç¿ëÀÚ¸¦ Ç¥½Ã ÇÏ·Á¸éÀÌ ÇÔ¼ö¸¦ È£Ãâ ÇÏ´Â ÇÁ·¹ÀÓ ¿öÅ©¡£

BeginWaitCursor µ¿ÀÛ µÇÁö ¾Ê½À´Ï´Ù Ç×»ó ´Ù¸¥ ÀÛ¾÷À¸·Î ´ÜÀÏ ¸Þ½ÃÁö 󸮱⠿ܺÎÀÇ È¿°úÀûÀÎ °°Àº OnSetCursor ó¸®, Ä¿¼­¸¦ º¯°æÇÒ ¼ö ÀÖ½À´Ï´Ù.

ÀüÈ­ EndWaitCursor ÀÌÀü Ä¿¼­¸¦ º¹¿ø ÇÏ·Á¸é¡£

¿¹Á¦

// The following example illustrates the most common case
// of displaying the hourglass cursor during some lengthy
// processing of a command handler implemented in some
// CCmdTarget-derived class, such as a document or view.

void CMyView::OnSomeCommand()
{
   BeginWaitCursor(); // display the hourglass cursor

   // do some lengthy processing

   EndWaitCursor(); // remove the hourglass cursor
}

// The next example illustrates RestoreWaitCursor.
void CMyView::OnSomeCommand()
{
   BeginWaitCursor(); // display the hourglass cursor

   // do some lengthy processing

   // The dialog box will normally change the cursor to
   // the standard arrow cursor, and leave the cursor in
   // as the standard arrow cursor when the dialog box is
   // closed.
   CMyDialog dlg;
   dlg.DoModal();

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

   // do some more lengthy processing

   EndWaitCursor(); // remove the hourglass cursor
}

// In the above example, the dialog was clearly invoked between
// the pair of calls to BeginWaitCursor and EndWaitCursor.
// Sometimes it may not be clear whether the dialog is invoked 
// in between a pair of calls to BeginWaitCursor and EndWaitCursor.
// It is permissable to call RestoreWaitCursor, even if 
// BeginWaitCursor was not previously called.  This case is 
// illustrated below, where CMyView::AnotherFunction does not
// need to know whether it was called in the context of an
// hourglass cursor.
void CMyView::AnotherFunction()
{
   // some processing ...

   CMyDialog dlg;
   dlg.DoModal();
   RestoreWaitCursor();

   // some more processing ...
}

// If the dialog is invoked from a member function of
// some non-CCmdTarget, then you can call CWinApp::DoWaitCursor
// with a 0 parameter value to restore the hourglass cursor.
void CMyObject::AnotherFunction()
{
   CMyDialog dlg;
   dlg.DoModal();
   AfxGetApp()->DoWaitCursor(0); // same as CCmdTarget::RestoreWaitCursor   
}

CCmdTarget °³¿ä |nbsp; Ŭ·¡½º ¸â¹ö (ko) | °èÃþ ±¸Á¶ Â÷Æ®(&N)

Âü°í Ç׸ñnbsp;CWaitCursor, CCmdTarget::EndWaitCursor, CCmdTarget::RestoreWaitCursor, CWinApp::DoWaitCursor(&N)

Index