GetPaletteEntries function (wingdi.h)

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

Syntax

UINT GetPaletteEntries(
  [in]  HPALETTE       hpal,
  [in]  UINT           iStart,
  [in]  UINT           cEntries,
  [out] LPPALETTEENTRY pPalEntries
);

Parameters

[in] hpal

A handle to the logical palette.

[in] iStart

The first entry in the logical palette to be retrieved.

[in] cEntries

The number of entries in the logical palette to be retrieved.

[out] pPalEntries

A 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 value

If the function succeeds and the handle to the logical 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 to the logical palette is NULL, the return value is the number of entries in the given palette.

If the function fails, the return value is zero.

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.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wingdi.h (include Windows.h)
Library Gdi32.lib
DLL Gdi32.dll

See also

Color Functions

Colors Overview

GetDeviceCaps

GetSystemPaletteEntries

PALETTEENTRY

SetPaletteEntries