I find that this situation arises from time to time, and I have never had a truly reliable universal solution.
I have a control - in this example, an EDIT control in a dialog box. I want to take action in response to the user - and only the user - modifies the contents of the edit control.
The edit control can be installed programmatically - for example. when the dialog is configured, there may be an initial value placed in the edit box. Or, when the user selects an item from the list, this selection text can be placed in the edit box.
But when the user changes the contents of the edit field, I need to know this and respond (in this case, I want to remove the selection from the corresponding list).
I am currently looking at what control has focus, and only considering that EN_CHANGE is "from the user" if the edit control has focus.
This works fine under Windows 7. This one does not work under XP (I have not tested Vista yet).
In XP, if the edit box has focus, but the user clicks on the list view and in the list view the control edits its contents, then I get a notification from the edit control that claims that there is still focus (:: GetFocus () = = HWND edit control). But this incorrect state does not occur in Win7.
This is a multi-level interface, so I cannot change the notification handler as a list. He receives a change of choice and updates the edit field without my involvement or the ability to really intervene, except to receive notifications from both of them.
Any thoughts on how to solve the puzzle βIs this a control notification from the userβ for a long time?