Converts an OLE_COLOR type to a COLORREF.
STDAPI OleTranslateColor (
OLE_COLOR clr, //Color to be converted into a COLORREF
HPALETTE hpal, //Palette used for conversion
COLORREF *pcolorref //Pointer to the caller's variable that
// receives the converted result
);
This function supports the standard return values E_INVALIDARG and E_UNEXPECTED, as well as the following:
The following table describes the color conversion:
OLE_COLOR | hPal | Resulting COLORREF |
---|---|---|
invalid | Undefined (E_INVALIDARG) | |
0x800000xx, xx is not a valid Win32 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 | NULL | 0x00bbggrr |
0x0100iiii, iiii is a valid palette index | NULL | 0x0100iiii |
0x02bbggrr (palette relative) | NULL | 0x02bbggrr |
0x00bbggrr | NULL | 0x00bbggrr |
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 |
Windows NT: Use version 4.0 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in olectl.h.
Import Library: Included as a resource in olepro32.dll.