## Presentation Device Driver Reference for OS/2

[prev][next][parent][TOC]

### GreQueryColorIndex - Parameters

hdc (HDC) - input Device context handle.

flOptions (ULONG) - input Options flag.

The only valid option is:

LCOLOPT_REALIZED If set, the information is required when the logical color table (if any) is realized. Otherwise, the information is required when the logical color table is not realized.

Other flags are reserved and must be 0.

rgbColor (LONG) - input Color, as an RGB value.

pInstance (PVOID) - input Pointer to instance data.

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

rc (LONG) - returns Return Code.

On completion, the handling routine must return the color index that provides the closest match to the specified color (lColorIndex), or GPI_ ALTERROR if an error occurred.

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_DEV_FUNC_NOT_INSTALLED
PMERR_INV_COLOR_OPTIONS
PMERR_INV_HDC
PMERR_INV_RGBCOLOR

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