OleSetColorScheme

3.1

  #include <ole.h>    

  OLESTATUS OleSetColorScheme(lpObject, lpPalette)    
  LPOLEOBJECT lpObject; /* address of object */
  const LOGPALETTE FAR* lpPalette; /* address of preferred palette */

The OleSetColorScheme function specifies the palette a client application recommends be used when the server application edits the specified object. The server application can ignore the recommended palette.

Parameters

lpObject

Points to an OLEOBJECT structure describing the object for which a palette is recommended.

lpPalette

Points to a LOGPALETTE structure specifying the recommended palette.

Return Value

The return value is OLE_OK if the function is successful. Otherwise, it is an error value, which may be one of the following:

OLE_BUSY
OLE_ERROR_COMM
OLE_ERROR_MEMORY
OLE_ERROR_OBJECT
OLE_ERROR_PALETTE
OLE_ERROR_STATIC
OLE_WAIT_FOR_RELEASE

The OleSetColorScheme function returns OLE_ERROR_OBJECT when it is called for a linked object.

Comments

A client application uses OleSetColorScheme to change the color scheme. The client does not need to call OleSetColorScheme every time a server is opened.

The first palette entry in the LOGPALETTE structure specifies the foreground color recommended by the client application. The second palette entry specifies the background color. The first half of the remaining palette entries are fill colors, and the second half are colors for lines and text.

Client applications should specify an even number of palette entries. When there is an uneven number of entries, the server interprets the odd entry as a fill color; that is, if there are five entries, three are interpreted as fill colors and two as line and text colors.

When server applications render metafiles, they should use the suggested palette.