Is there a way to suspend/resume the Undo recording in a TRichEdit control? Is there a message to send or a mode to set?
EDIT
I have solved it by using the ITextDocument interface. See my post below.
Is there a way to suspend/resume the Undo recording in a TRichEdit control? Is there a message to send or a mode to set?
EDIT
I have solved it by using the ITextDocument interface. See my post below.
See the EM_SETUNDOLIMIT
message:
Sets the maximum number of actions that can stored in the undo queue of a rich edit control.
Parameters
wParam Specifies the maximum number of actions that can be stored in the undo queue.
lParam This parameter is not used; it must be zero.
Return value
The return value is the new maximum number of undo actions for the rich edit control. This value may be less than wParam if memory is limited.
Remarks
By default, the maximum number of actions in the undo queue is 100. If you increase this number, there must be enough available memory to accommodate the new number. For better performance, set the limit to the smallest possible value.
Setting the limit to zero disables the Undo feature.
Okay I solved it.
You have to use the
ITextDocument
interface to set the various undo modes. In this exampleScript_Edit
is aTRichEdit
control.The
ITextDocument->Undo()
can be used with:I hope this can be useful to others too...