GetSystemPaletteEntries function

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(
  HDC            hdc,
  UINT           iStart,
  UINT           cEntries,
  LPPALETTEENTRY pPalEntries
);

Parameters

hdc

A handle to the device context.

iStart

The first entry to be retrieved from the system palette.

cEntries

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

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. 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

   
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