## Presentation Device Driver Reference for OS/2

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

### GreDeviceDeletePalette - Syntax

Simulation support:

This function is simulated by a handling routine in Revision 2.0 (or later) of the graphics engine.

Description

GreDeviceDeletePalette is called by the graphics engine when a palette is selected out of a device context. This can occur in many situations, including when an application selects a new palette using GpiSelectPalette or deletes a palette using GpiDeletePalette. It informs the device to delete its instance of the palette for the given device context. The DC should be reset to the default color table. It is the responsibility of the presentation driver to determine if any other device contexts are using the palette. In this case, the presentation driver does not free the internal data structures needed for palette realization.

This function can be hooked by the presentation driver.

    #define INCL_GRE_PALETTE

    #include <os2.h>

    HDC      hdc;        /*  Device context handle. */

    ULONG    hdevpal;    /*  Handle to the device palette from GreDeviceCreatePalette. */

    PVOID    pInstance;  /*  Pointer to instance data. */

    ULONG    lFunction;  /*  High-order WORD=flags; low-order WORD=NGreDeviceDeletePalette.
      * /

    LONG       rc ;           / *    Return   codes .   * /

    rc   =   GreDeviceDeletePalette ( hdc ,   hdevpal ,

            pInstance ,   lFunction ) ;