GpiDeletePalette

From EDM2
Jump to: navigation, search

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