GetPaletteEntries

The GetPaletteEntries function retrieves a specified range of palette entries from the given logical palette.

UINT GetPaletteEntries(
  HPALETTE hpal,        // handle of logical color palette
  UINT iStartIndex,     // first entry to retrieve
  UINT nEntries,        // number of entries to retrieve
  LPPALETTEENTRY lppe   // address of array receiving entries
);
 

Parameters

hpal
Handle to the logical color palette.
iStartIndex
Specifies the first entry in the logical palette to be retrieved.
nEntries
Specifies the number of entries in the logical palette to be retrieved.
lppe
Pointer to an array of PALETTEENTRY structures to receive the palette entries. The array must contain at least as many structures as specified by the nEntries parameter.

Return Values

If the function succeeds and the handle of the logical color palette is a valid pointer (not NULL), the return value is the number of entries retrieved from the logical palette. If the function succeeds and handle of the logical color palette is NULL, the return value is the number of entries in the given palette.

If the function fails, the return value is zero.

Windows NT: To get extended error information, call GetLastError.

Remarks

An application can determine whether a device supports palette operations by calling the GetDeviceCaps function and specifying the RASTERCAPS constant.

If the nEntries parameter specifies more entries than exist in the palette, the remaining members of the PALETTEENTRY structure are not altered.

Windows CE: The GetPaletteEntries function will fail if iStartIndex is greater than the number of palette entries.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Requires version 2.0 or later.
  Header: Declared in wingdi.h.
  Import Library: Use gdi32.lib.

See Also

Colors Overview, Color Functions, GetDeviceCaps, GetSystemPaletteEntries, SetPaletteEntries, PALETTEENTRY