Microsoft KB Archive/199852

{|
 * width="100%"|

HOWTO: Suspend and Resume the Undo Functionality in Richedit 3.0

 * }

Q199852

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK), on platform(s):
 * the operating system: Microsoft Windows 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-&gt;Undo(tomFalse,NULL); //Prevents Undo and empties buffer.

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

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

pITextDocument-&gt;Undo(tomResume,NULL); //Resumes Undo. Additional query words: rich edit

Keywords : kbOSWinNT400 kbOSWin2000 kbRichEdit kbSDKPlatform kbSDKWin32

Issue type : kbhowto

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch