在派生类中重载消息OnChildNotify,可以改变字体的颜色
BOOL CMyEdit::OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pLResult)
{
// TODO: Add your specialized code here and/or call the base class
if(message!=WM_CTLCOLOREDIT)
{
return CEdit::OnChildNotify(message, wParam, lParam, pLResult);
}
else
{
HDC hdc=(HDC)wParam;
SetTextColor(hdc,0X8000);
return TRUE;
}
}