I am writing a program that has an Edit control. It can be changed by both the user and the program itself (by SetWindowText). When the user changes it, I want to check if it fits another criteria and reverse it if it fails. However, when the program changes it, I will let it change without checking the criteria. I try to use OnEditChange to catch the change and then check for the criteria, but when it is changed by the program, it get checked the same way.
How can I distinquish whether the OnChange is called by a user change or a program change?