I finally found a suitable solution to my problem.
First, I added a flag to my derived control header file, and I initialized it to false in the constructor
bool m_bNoEnChange;
I overridden OnChildNotify in my derived control header file and in the implementation, I checked the WM_COMMAND message with the EN_CHANGE parameter. Then I returned TRUE to prevent sending a message to my parents (dialog / page)
virtual BOOL OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pLResult);
BOOL CADEdit::OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pLResult)
{
if(message == WM_COMMAND && HIWORD(wParam) == EN_CHANGE)
{
if(m_bNoEnChange)
return TRUE;
}
return CEdit::OnChildNotify(message, wParam, lParam, pLResult);
}
, , SetWindowText
m_bNoEnChange = true;
SetWindowText(_T(""));
m_bNoEnChange = false;
, .