Jump to content

GpiDeletePalette

From EDM2
Revision as of 04:51, 27 May 2017 by Martini (talk | contribs) (Created page with "This function deletes a color palette. ==Syntax== <PRE> rc = GpiDeletePalette(hpal); </PRE> ==Parameters== ; hpal (HPAL) - input: Palette handle. ==Return Code== ; rc (BOOL)...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function deletes a color palette.

Syntax

rc = GpiDeletePalette(hpal);

Parameters

hpal (HPAL) - input
Palette handle.

Return Code

rc (BOOL) - returns
Success indicator.
  • TRUE Successful completion
  • FALSE Error occurred.

Errors

Possible returns from WinGetLastError

PMERR_INV_HPAL (0x2111)
An invalid color palette handle was specified.
PMERR_PALETTE_SELECTED (0x210F)
Color palette operations cannot be performed on a presentation space while a palette is selected.
PMERR_PALETTE_BUSY (0x2112)
An attempt has been made to reset the owner of a palette when it was busy.

Remarks

The palette must not be currently selected into a presentation space (see GpiSelectPalette).

Example Code

This example uses GpiDeletePalette to delete the color palette currently associated with the presentation space, which is determined using GpiQueryPalette.

#define INCL_GPILOGCOLORTABLE /* Color Table functions */
#include <os2.h>

BOOL fSuccess; /* success indicator */
HPAL hpal; /* palette handle */
HPS hps; /* Presentation-space handle */

/* get handle of currently associated palette */
hpal = GpiQueryPalette(hps);

/* delete palette */
fSuccess = GpiDeletePalette(hpal);

Related Functions

  • GpiAnimatePalette
  • GpiCreatePalette
  • GpiQueryPalette
  • GpiQueryPaletteInfo
  • GpiSelectPalette
  • GpiSetPaletteEntries