|
-
Aug 22nd, 2001, 04:43 PM
#1
Thread Starter
Member
best way
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
-
Aug 23rd, 2001, 05:07 AM
#2
Frenzied Member
You can use this API
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.
-
Aug 23rd, 2001, 09:03 AM
#3
Thread Starter
Member
thanks
thought this might help, but it doesnt solve my problem. argh im getting annoyed.
Gregg
-
Aug 23rd, 2001, 09:16 AM
#4
You have to subclass your window and capture the WM_CTLCOLORDLG messag first. Then you can call the function from there.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|