MSDN. CWnd::OnCtlColor
http://msdn.microsoft.com/en-us/library/0wwk06hc(VS.80).aspxWhen you create a window, create a brush:
m_Brush = new CBrush(RGB(150, 150, 150));
and in OnCtlColor when the parameter is CTLCOLOR_EDIT, set the color for the text and the background and return the brush:
pDC->SetTextColor(RGB(0, 255, 0));
pDC->SetBkColor(RGB(0, 0, 0));
return (HBRUSH)(m_Brush->GetSafeH
andle());
otherwise:
return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
delete the brush when you close the window.
More:
Changing the Background Color of an Edit Control
http://www.codeguru.com/cpp/controls/editctrl/backgroundcolor/article.php/c9047