GpiQueryPalette
Appearance
This function returns the handle of the palette currently selected into a presentation space.
Syntax
hpal = GpiQueryPalette(hps);
Parameters
- hps (HPS) - input
- Presentation-space handle.
Return Code
- hpal (HPAL) - returns
- Palette handle.
- NULLHANDLE Null handle (no palette is selected)
- PAL_ERROR Error occurred
- Otherwise Handle of the palette currently selected into this presentation space.
Errors
Possible returns from WinGetLastError
- PMERR_INV_HPS (0x207F)
- An invalid presentation-space handle was specified.
- PMERR_PS_BUSY (0x20F4)
- An attempt was made to access the presentation space from more than one thread simultaneously.
Remarks
It is possible for a palette to be selected into more than one presentation space at any one time. See GpiSelectPalette.
Example Code
This example uses GpiQueryPalette to return the handle of the palette currently selected into a presentation space and then calls GpiDeletePalette to delete the palette.
#define INCL_GPILOGCOLORTABLE /* Color Table functions */ #include <os2.h> HPAL hpal; /* palette handle */ HPS hps; /* Presentation-space handle */ BOOL fSuccess; /* success indicator */ /* get handle of currently associated palette */ hpal = GpiQueryPalette(hps); /* delete palette */ fSuccess = GpiDeletePalette(hpal);