OleSetColorScheme

  OLESTATUS OleSetColorScheme(lpObject, lpPalette);    
  LPOLEOBJECT lpObject; /* pointer to object */
  const LOGPALETTE FAR* lpPalette; /* pointer to 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 can 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

Comments

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 rounds to the fill colors; that is, if there were seven entries, three would be interpreted as fill colors and two as line and text colors.