重截WM_CTLCOLOR的响应函数
HBRUSH CChatDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
HBRUSH hbru = ::CreateSolidBrush (RGB(255,255,255));
if(pWnd->GetDlgCtrlID() == IDC_EDIT_REC)
{
pDC->SetTextColor(RGB(0,0,0)); //设置字体颜色
pDC->SetBkColor(RGB(255,255,255)); //设置背景色
return hbru; //这句很重要!
}
return hbr;
}`