GetPaletteEntries

  UINT GetPaletteEntries(hpal, iStartIndex, nEntries, lppe)    
  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 */

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

Parameters

hpal

Identifies the logical 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

Points to an array of PALETTEENTRY structures to receive the palette entries. The array must contain at least as many data structures as specified by the nEntries parameter. If this parameter is NULL, then the number of entries in the palette will be returned. The PALETTEENTRY structure has the following format:

typedef struct tagPALETTEENTRY { /* pe */

BYTE peRed;

BYTE peGreen;

BYTE peBlue;

BYTE peFlags;

} PALETTEENTRY;

Return Value

The return value specifies the number of entries retrieved from the logical palette if lppe was not NULL and the function was successful; if lppe was NULL and the function was successful, the return value specifies the number of entries in the given palette. Otherwise it is zero.

Comment

If nEntries specifies more entries than exist in the palette, the remaining fields of lppe will not be altered.

See Also

PALETTEENTRY