@Arioch: I don't know if you're referring to my post - I actually didn't give a description, but I posted sample code: after entering the memo, I calculate the hash of the current text, which is also calculated on exit and compared with the initial one. Based on this, it is checked whether a modification has occurred - this is resistant to undoing changes.