'Delphi: Disable undo in Memo/Edit

I have implemented an UndoManager for a TMemo/TEdit and now I want to disable default Undo behavior (Ctrl+Z and Undo in context menu) is these components and instead do my undo/redo commands.

I tried to catch WM_UNDO, but Ctrl+Z seems sending another message. Also I don't know how to handle it after message received (for example for WM_PASTE we could clear clipboard)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source