M
Hiermit färbe ich z.B ein "static control" mit RGB Farben aus CHOOSECOLOR.
Habe es innerhalb eines Propertysheets bei WM_PAINT und WM_ERASEBKGND entsprechend eingebunden.
void FillBlock(HWND hwnd, COLORREF color)
{
HDC hdc = GetDC(hwnd);;
RECT rect;
HBRUSH hbrush, holdbrush;
GetClientRect(hwnd,&rect);
hbrush = CreateSolidBrush(color);
holdbrush = (HBRUSH) SelectObject(hdc,hbrush);
Rectangle(hdc,rect.left,rect.top,rect.right,rect.bottom);
DeleteObject(SelectObject(hdc,holdbrush));
ReleaseDC(hwnd,hdc);
}
Hope this helps,
Frank