GetSystemPaletteEntries function (wingdi.h)

The GetSystemPaletteEntries function retrieves a range of palette entries from the system palette that is associated with the specified device context (DC).

Syntax

UINT GetSystemPaletteEntries(
  [in]  HDC            hdc,
  [in]  UINT           iStart,
  [in]  UINT           cEntries,
  [out] LPPALETTEENTRY pPalEntries
);

Parameters

[in] hdc

A handle to the device context.

[in] iStart

The first entry to be retrieved from the system palette.

[in] cEntries

The number of entries to be retrieved from the system palette.

[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 cEntries parameter. If this parameter is NULL, the function returns the total number of entries in the palette.

Return value

If the function succeeds, the return value is the number of entries retrieved from the 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.

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

GetPaletteEntries

PALETTEENTRY