Gdi32SetBkColor Method

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.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("GDI32.dll")]
public static uint SetBkColor(
	IntPtr hdc,
	int color
)

Parameters

hdc  IntPtr
A handle to the device context.
color  Int32
The new background color. To make a COLORREF value, use the RGB macro.

Return Value

UInt32
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 (-1 or 0xFFFFFFFF).

Remarks

See Also