19,468
社区成员
发帖
与我相关
我的任务
分享
HBRUSH CSeleGuidDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if( nCtlColor==CTLCOLOR_EDIT && pWnd->GetDlgCtrlID()==IDC_EDIT_COLOR )
{
pDC->SetTextColor( colorSelect );
pDC->SetBkColor( colorSelect );
HBRUSH hBr = CreateSolidBrush(colorSelect); // 背景色
return (HBRUSH) hBr;
};
// TODO: Return a different brush if the default is not desired
return hbr;
}
COLORREF RGB(
BYTE byRed, // red component of color
BYTE byGreen, // green component of color
BYTE byBlue // blue component of color
);