GreQueryHWPaletteInfo

GreQueryHWPaletteInfo fills a buffer with the RGB value information from the hardware palette. The order of the returned values is the same as the hardware. Both RGB values and the user defined xxxxx are returned. If cclr=0, only the size required for the buffer referenced by pclr is returned. The information returned can be used to create a palette. This allows a caller to create the same palette in another device context.

This function can be hooked by the presentation driver.


 * Simulation support: This function is simulated by a handling routine in the graphics engine.

Syntax
GreQueryHWPaletteInfo(hdc, ulStart, cclr, pclr, pInstance, lFunction);

Parameters

 * hdc (HDC) - input
 * Device context handle.


 * ulStart (ULONG) - input
 * Starting index, first palette entry to query.


 * cclr (ULONG) - input
 * Count of palette entries.


 * pclr (PULONG) - input
 * Pointer to table of RGB2 palette entries.


 * pInstance (PVOID) - input
 * Pointer to instance data.


 * lFunction (ULONG) - input
 * High-order WORD=flags; low-order WORD=NGreQueryHWPaletteInfo.

Returns

 * fSuccess (BOOL) - returns
 * Return codes.


 * This function returns BOOLEAN (fSuccess).


 * TRUE Successful
 * FALSE Error


 * Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:


 * PMERR_INV_PALETTE


 * Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.

Sample

 * 1) define INCL_GRE_PALETTE
 * 2) include 

HDC      hdc;        /*  Device context handle. */ ULONG    ulStart;    /*  Starting index, first palette entry to query. */ ULONG    cclr;       /*  Count of palette entries. */ PULONG   pclr;       /*  Pointer to table of RGB2 palette entries. */ PVOID    pInstance;  /*  Pointer to instance data. */ ULONG    lFunction;  /*  High-order WORD=flags; low-order WORD=NGreQueryHWPaletteInfo. */ BOOL     fSuccess;   /*  Return codes. */

fSuccess = GreQueryHWPaletteInfo(hdc, ulStart,            cclr, pclr, pInstance, lFunction);

Remarks
The existing color table GreQueryxxx APIs are still supported.