Jump to content

GpiDeletePalette: Difference between revisions

From EDM2
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)..."
 
 
Line 44: Line 44:


==Related Functions==
==Related Functions==
* GpiAnimatePalette
* [[GpiAnimatePalette]]
* GpiCreatePalette
* [[GpiCreatePalette]]
* GpiQueryPalette
* [[GpiQueryPalette]]
* GpiQueryPaletteInfo
* [[GpiQueryPaletteInfo]]
* GpiSelectPalette
* [[GpiSelectPalette]]
* GpiSetPaletteEntries
* [[GpiSetPaletteEntries]]


[[Category:Gpi]]
[[Category:Gpi]]

Latest revision as of 17:46, 24 February 2020

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