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 function sets RGB color values and flags in a range of entries in a logical palette.

Syntax

UINT SetPaletteEntries( 
  HPALETTE 
hpal, 
  UINT 
iStart, 
  UINT 
cEntries, 
  CONST PALETTEENTRY* 
lppe
);

Parameters

hpal

[in] Handle to the logical palette.

iStart

[in] Specifies the first logical-palette entry to be set.

This function fails if iStartis greater than the number of palette entries.

cEntries

[in] Specifies the number of logical-palette entries to be set.

lppe

[in] Long pointer to the first member of an array of PALETTEENTRYstructures containing the RGB values and flags.

Return Value

The number of entries that were set in the logical palette indicates success.

Zero indicates failure.

To get extended error information, call GetLastError.

Remarks

An application can determine whether or not a device supports palette operations by calling the GetDeviceCapsfunction and specifying the RASTERCAPS constant.

Even if a logical palette has been selected and realized, changes to the palette do not affect the physical palette in the surface. RealizePalettemust be called again to set the new logical palette into the surface.

Requirements

Header windows.h
Library coredll.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also