Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
OleTranslateColor
Collapse the table of content
Expand the table of content

OleTranslateColor function

Converts an OLE_COLOR type to a COLORREF.

Syntax


HRESULT OleTranslateColor(
  _In_  OLE_COLOR clr,
  _In_  HPALETTE  hpal,
  _Out_ COLORREF  *lpcolorref
);

Parameters

clr [in]

The OLE color to be converted into a COLORREF.

hpal [in]

Palette used as a basis for the conversion.

lpcolorref [out]

Pointer to the caller's variable that receives the converted COLORREF result. This parameter can be NULL, indicating that the caller wants only to verify that a converted color exists.

Return value

This function supports the standard return values E_INVALIDARG and E_UNEXPECTED, as well as the following value.

Return codeDescription
S_OK

The color was translated successfully.

 

Remarks

The following table describes the color conversion.

OLE_COLORhPalCOLORREF
invalid Undefined (E_INVALIDARG)
0x800000xx, xx is not a valid GetSysColor index Undefined (E_INVALIDARG)
invalid Undefined (E_INVALIDARG)
0x0100iiii, iiii is not a valid palette index valid palette Undefined (E_INVALIDARG)
0x800000xx, xx is a valid GetSysColor index NULL0x00bbggrr
0x0100iiii, iiii is a valid palette index NULL0x0100iiii
0x02bbggrr (palette relative) NULL0x02bbggrr
0x00bbggrr NULL0x00bbggrr
0x800000xx, xx is a valid GetSysColor index valid palette 0x00bbggrr
0x0100iiii, iiii is a valid palette index in hPal valid palette 0x0100iiii
0x02bbggrr (palette relative) valid palette 0x02bbggrr
0x00bbggrr valid palette 0x02bbggrr

 

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

OleCtl.h

Library

OleAut32.lib

DLL

OleAut32.dll

 

 

Community Additions

ADD
Show:
© 2015 Microsoft