What is the best way to set a DC's background color?
An api call made for it?
Or do I have to get the RECT and FillRect first, then draw on top of that?
Gregg
Printable View
What is the best way to set a DC's background color?
An api call made for it?
Or do I have to get the RECT and FillRect first, then draw on top of that?
Gregg
You can use this API
Quote:
SetBkColor
The SetBkColor function sets the current background color to the specified color value, or to the nearest physical color if the device cannot represent the specified color value.
COLORREF SetBkColor(
HDC hdc, // handle of device context
COLORREF crColor // background color value
);
Parameters
hdc
Handle to the device context.
crColor
Specifies the new background color.
Return Values
If the function succeeds, the return value specifies the previous background color as a COLORREF value.
If the function fails, the return value is CLR_INVALID.
Windows NT: To get extended error information, callGetLastError.
thought this might help, but it doesnt solve my problem. argh im getting annoyed.
Gregg
You have to subclass your window and capture the WM_CTLCOLORDLG messag first. Then you can call the function from there.