I have a richtext edit control and I'm trying to figure out if a user has done any changes or not, before closing the window.
I've tried the modified event without success. I rarely seems to fire.
I've tried the key-event (pbm_rnkey) without success: it only seems to be triggered for keys like ctrl, shift, alt, backspace, etc.
I've tried the pbm_keyup and -down, no success.
If I just typ an 's' those events aren't fired. Is this a bug maybe?
I know that edit controls have a more limited information in the key events. Like you cannot ask for the keyflags in combination with the key parameter.
I need to set a boolean like ib_changed = true, to be able to know whether I have to ask to save changes or not, when a user does ALT+F4. (mind that ALT would trigger the key event).
When / Where could I set this?
The only way out that I see at this moment, is to save the original contents when opening the window and comparing it against whatever contents there is at the moment of saving.
I was hoping for a more elegant way of doing this.
Any ideas are welcome,
TIA