背景改变了,但文字颜色没有变化。
这是我的代码:
case WM_CTLCOLORSTATIC:
{
DWORD CtrlID = GetDlgCtrlID((HWND)lParam); //Window Control ID
if(CtrlID == IDC_CHECK_CHAT)
{
HDC hdcStatic = (HDC) wParam;
SetTextColor(hdcStatic, RGB(255,255,255));
SetBkColor(hdcStatic, RGB(70,70,70));
return (INT_PTR)hBrush;
}
}
资源文件:
CONTROL "Blah Blah Blah",IDC_CHECK_CHAT,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,72,137,10