Knowledge Base

How To Suspend and Resume the Undo Functionality in Richedit 3.0

Article ID: 199852

Article Last Modified on 7/11/2005


APPLIES TO


This article was previously published under Q199852

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: kbhowto kbrichedit KB199852