Jump to content

GreUnrealizeColorTable

From EDM2
Revision as of 00:22, 1 December 2019 by Martini (talk | contribs) (Created page with "GreUnrealizeColorTable reverses GreRealizeColorTable by causing the default physical color table for the device to be reinstated. This function must be supported by the pres...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

GreUnrealizeColorTable reverses GreRealizeColorTable by causing the default physical color table for the device to be reinstated.

This function must be supported by the presentation driver. GreUnrealizeColorTable is called by GpiUnRealizeColorTable in response to the request of an application to restore the application's logical color table prior to the last call to GpiRealizeColorTable. This function can be handled by bit-map simulation.

Simulation support
None. This function is mandatory for all drivers.

Syntax

GreUnrealizeColorTable(hdc, pInstance, lFunction);

Parameters

hdc (HDC) - input
Device context handle.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreUnrealizeColorTable.

Returns

rc (BOOL) - returns
Return codes.

On completion, the handling routine must return a BOOLEAN value to indicate success or an error.

  • 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_COL_TABLE_NOT_REALIZED
  • PMERR_DEV_FUNC_NOT_INSTALLED
  • PMERR_INV_HDC
  • PMERR_INV_IN_AREA
  • PMERR_INV_IN_PATH

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


Sample

#define INCL_GRE_COLORTABLE
#include <os2.h>

HDC      hdc;        /*  Device context handle. */
PVOID    pInstance;  /*  Pointer to instance data. */
ULONG    lFunction;  /*  High-order WORD=flags; low-order WORD=NGreUnrealizeColorTable. */
BOOL     rc;         /*  Return codes. */

rc = GreUnrealizeColorTable(hdc, pInstance,
       lFunction);

Remarks

The logical color table is unaffected by this function.

Note
GreUnrealizeColorTable is provided for the support of older applications and is of less importance for new applications.