Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method specifies the color palette that the object application should use when it edits the specified object.

Syntax

HRESULT SetColorScheme( 
  LOGPALETTE* 
pLogpal
);

Parameters

pLogpal

[in] Pointer to a LOGPALETTEstructure that specifies the recommended palette.

Return Value

One of the values in the following table is returned.

Value Description

S_OK

Color palette received successfully.

E_NOTIMPL

Object does not support setting palettes.

OLE_E_PALETTE

Invalid LOGPALETTEstructure pointed to by lpLogPal.

OLE_E_NOTRUNNING

Object must be running to perform this operation.

Remarks

The SetColorSchememethod sends the container application's recommended color palette to the object application, which is not obliged to use it.

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Notes to Implementers

Upon receiving the palette, the object application should do the following:

  1. Allocate and fill in its own LOGPALETTEstructure with the colors specified in the container application's LOGPALETTEstructure.

  2. Call CreatePalette (GDI)to create a palette from the resulting LOGPALETTEstructure.

    This palette can be used to render objects and color menus as the user edits objects in the document.

The first palette entry in the LOGPALETTEstructure specifies the foreground color recommended by the container.

The second palette entry specifies the recommended background color.

The first half of the remaining palette entries are fill colors; the second half are colors for lines and text.

Container applications typically specify an even number of palette entries.

If a container specifies an odd number of entries, the object application should assume that the first half of the total entries plus one designate fill colors, while the remainder designate line and text colors.

For example, if there are five entries, the first three should be interpreted as fill colors and the last two as line and text colors.

Requirements

Header Oleidl.h, oleidl.idl
Library oleaut32.lib, uuid.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also