网站首页  计算机词典

请输入您要查询的字词:

 

字词 CCmdTarget::RestoreWaitCursor
释义 CCmdTarget::RestoreWaitCursor

void RestoreWaitCursor( );

说明:
本函数用于在系统光标改变后重置沙漏标(例如,在一个耗时操作的过程中打开一个消息窗口而后又关闭它。)

示例:
// 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,the you 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::RestorWaitCursor
}

请参阅:
CWaitCursor, CCmdTarget::EndWaitCursor, CCmdTarget::BeginWaitCursor, CWinApp::DoWaitCursor
随便看

 

计算机英汉双解词典包含34412条计算机术语英汉翻译词条,基本涵盖了全部常用计算机术语的翻译及用法,是计算机学习及翻译工作的有利工具。

 

Copyright © 2021-2025 foosec.com All Rights Reserved
更新时间:2026/10/24 1:32:49