case WM_CTLCOLOREDIT:
{
HWND hShellText = GetDlgItem(hDlg,IDC_TXT_SHELL);
if (hShellText == (HWND)lParam)
{
HDC hdc = (HDC)wParam;
SetTextColor(hdc,RGB(,,));
SetBkColor(hdc,RGB(,,)); }
return(INT_PTR) GetSysColorBrush(COLOR_BACKGROUND);
}
break;
响应以上消息,就可以得到 黑底 绿字的像个dos窗口的editctrl了,字体还不太像,下面在设置下字体
static HFONT hFont = CreateFont(, // nHeight
, // nWidth
, // nEscapement
, // nOrientation
FW_MEDIUM, // nWeight
false, // bItalic
FALSE, // bUnderline
, // cStrikeOut
DEFAULT_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS,
_T("Courier") //Terminal Courier // nPitchAndFamily
);
HWND hShellText = GetDlgItem(hwnd,IDC_TXT_SHELL);
SendMessage(hShellText,WM_SETFONT,(WPARAM)hFont,true);
这样就像多了