CDC::SelectPalette

CPalette*SelectPalette(CPalette*pPalette,BOOLbForceBackground**);**

Return Value

A pointer to a CPalette object identifying the logical palette replaced by the palette specified by pPalette. It is NULL if there is an error.

Parameters

pPalette

Identifies the logical palette to be selected. This palette must already have been created with the CPalette member function CreatePalette.

bForceBackground

Specifies whether the logical palette is forced to be a background palette. If bForceBackground is nonzero, the selected palette is always a background palette, regardless of whether the window has the input focus. If bForceBackground is 0 and the device context is attached to a window, the logical palette is a foreground palette when the window has the input focus.

Remarks

Selects the logical palette that is specified by pPalette as the selected palette object of the device context. The new palette becomes the palette object used by GDI to control colors displayed in the device context and replaces the previous palette.

An application can select a logical palette into more than one device context. However, changes to a logical palette will affect all device contexts for which it is selected. If an application selects a palette into more than one device context, the device contexts must all belong to the same physical device.

CDC OverviewClass MembersHierarchy Chart

See Also   CDC::RealizePalette, CPalette,