Copyright: Palette Support Component Help


Palette Component - Overview

Insert tbe Palette component to set up your MFC-based application to use palettes and correctly interact with other applications that use palettes.

Palette Component - Specifics

Palette Component - Results


Palette Component - Specifics

Inserting this component will add handlers for the WM_QUERYNEWPALETTE and WM_PALETTECHANGED window messages. These handlers will deal with requests from Windows to realize your application's palette when it is activated or when another application changes the hardware palette.


Palette Component - Results

After inserting your component, your code will simply need to call the SetPalette function that will be added to windows with palette support. This will cause a new palette to be selected and realized and other applications will be notified of the change. The palette passed to SetPalette will be remembered by windows with palette support for use when Windows sends the palette messages. Be sure to call SetPalette with a NULL parameter if the previously used palette gets destroyed.

For MDI applications, a good time to call SetPalette is in your CView-derived class's OnActivateView function.


Palette Component Dialog

Use this dialog box to select a window to add palette support to.