HBRUSH CEditCtrl::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CWnd::OnCtlColor(pDC, pWnd, nCtlColor);
if (pWnd == m_pEdit)
{
HBRUSH newHbr = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
pDC->SetTextColor(m_color);
pDC->SetBkColor(RGB(0,0,0));
pDC->SelectObject(m_pFont);
return newHbr;
}
return hbr;
}
int CEditCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
m_pFont->CreateFontW(
m_nFontHeigth, // nHeight
m_nFontWidth, // nWidth
0, // nEscapement
0, // nOrientation
m_nFontWeight, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
m_lpszFacename); // lpszFacename
return 0;
}