The GetSystemPaletteEntries function retrieves a range of palette entries from the system palette that is associated with the specified device context.
UINT GetSystemPaletteEntries(
HDC hdc, // handle of device context
UINT iStartIndex, // index of first entry to be retrieved
UINT nEntries, // number of entries to be retrieved
LPPALETTEENTRY lppe // array receiving system-palette entries
);
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.
Windows NT: To get extended error information, call GetLastError.
An application can determine whether a device supports palette operations by calling the GetDeviceCaps function and specifying the RASTERCAPS constant.
Windows CE: The GetSystemPaletteEntries function will fail if the device associated with hdc does not have a settable palette. Use GetDeviceCaps to determine if the device has a settable palette before using GetSystemPaletteEntries.
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.
Colors Overview, Color Functions, GetDeviceCaps, GetPaletteEntries, PALETTEENTRY