mfc

How to avoid EN_CHANGE notifications when sending WM_SETTEXT?

你。 提交于 2020-08-24 07:06:06
问题 I have a CEdit derived control that displays the string "N/A" when the undelying data is null. I recently added code to empty the control(SetWindowText("");) when it gains focus and set if back to "N/A"(SetWindowText("N/A")) when the focus is lost if the user left the control empty. The only problem is that setting the window text to "" or "N/A" triggers EN_CHANGE, so my dialog thinks that the data has changed. How can I avoid EN_CHANGE from being fired when calling SetWindowText (WM_SETTEXT)