HOWTO: Suspend and Resume the Undo Functionality in Richedit 3.0

ID: Q199852


The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK)
    on the following platforms: NT


SUMMARY

It is possible to suspend and resume the Undo operation in a Richedit version 3.0 control. The Undo() method in the ITextDocument interface accepts a long value "tomFalse" to suspend the Undo operation and "tomTrue" to resume the Undo operation. This method completely suspends the Undo operation; in other words, the Undo buffer is emptied. When the operation is resumed again, the Undo buffer is filled from the beginning.

If it is necessary to Undo an action that is performed before a suspend, after resuming the Undo, then, tomFalse must be replaced with "tomSuspend" and tomTrue must be replaced with "tomResume". This method retains the contents of the Undo buffer even when Undo is suspended.


MORE INFORMATION

Following is the code for the methods described above:


pITextDocument->Undo(tomFalse,NULL); //Prevents Undo and empties buffer.

pITextDocument->Undo(tomTrue,NULL); //Restarts Undo again.

pITextDocument->Undo(tomSuspend,NULL); //Suspends Undo.

pITextDocument->Undo(tomResume,NULL); //Resumes Undo. 

Additional query words: rich edit

Keywords : kbNTOS400 kbWinOS2000 kbRichEdit kbSDKPlatform kbSDKWin32
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: January 23, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.