GpiQueryPattern
Appearance
This function returns the current value of the shading-pattern symbol, as set by the GpiSetPattern function.
Syntax
#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, Also in COMMON section */ #include <os2.h> HPS hps; /* Presentation-space handle. */ LONG lPatternSymbol; /* Pattern symbol. */ lPatternSymbol = GpiQueryPattern(hps);
Parameters
- hps (HPS) - input
- Presentation-space handle.
Return Code
- lPatternSymbol (LONG) - returns
- Pattern symbol.
- PATSYM_DEFAULT Default
- PATSYM_DENSE1 to PATSYM_DENSE8 (1L to 8L) Solid shading with decreasing density
- PATSYM_VERT (9L) Vertical pattern
- PATSYM_HORIZ (10L) Horizontal pattern
- PATSYM_DIAG1 to PATSYM_DIAG1 (11L to 14L) Diagonal pattern 1 to 4, bottom left to top right
- PATSYM_NOSHADE (15L) No shading
- PATSYM_SOLID (16L) Solid shading
- PATSYM_HALFTONE (17L) Alternate pels set on
- PATSYM_BLANK (18L) Blank
- PATSYM_ERROR (-1L) Error.
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.
- PMERR_INV_IN_RETAIN_MODE (0x208C)
- An attempt was made to issue a function (for example, query) that is invalid when the actual drawing mode is not draw or draw-and-retain.
- PMERR_INV_DC_TYPE (0x2060)
- An invalid type parameter was specified with DevOpenDC, or a function was issued that is invalid for a OD_METAFILE_NOQUERY device context.
Remarks
This function is invalid when the drawing mode (see GpiSetDrawingMode) is set to retain.
Example Code
In this example we query the current value of the shading-pattern symbol, as set by the GpiSetPattern call.
#define INCL_GPIPRIMITIVES #include <OS2.H> LONG lResult; /* pattern symbol if > 0 */ HPS hps; /* Presentation space handle. */ if(PATSYM_SOLID == GpiQueryPattern(hps)) { /* . */ /* . */ }