Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
CDC::SelectPalette
CDC                                         Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  CPalette* SelectPalette( CPalette* pPalette, BOOL bForceBackground );
 
  Parameter          Description
 
  <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 TRUE,
                     the selected palette is always a background palette,
                     regardless of whether the window has input focus. If
                     <bForceBackground> is FALSE, the logical palette is a
                     foreground palette when the window has input focus.
 
  Remarks
 
  Selects the logical palette 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
  object into more than one device context, the device contexts must all
  belong to the same physical device (such as a display or printer).
 
  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.
 
  See Also
 
  CPalette, ::SelectPalette
 
 
                                     -♦-