GpiQueryDrawControl
Appearance
This function returns a drawing control as set by GpiSetDrawControl.
Syntax
GpiQueryDrawControl(hps, lControl)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- lControl (LONG) - input
- Control whose value is to be returned.
- DCTL_ERASE
- Erase before draw
- DCTL_DISPLAY
- Display
- DCTL_BOUNDARY
- Accumulate boundary data
- DCTL_DYNAMIC
- Draw dynamic segments
- DCTL_CORRELATE
- Correlate.
Return Value
- lValue (LONG) - returns
- Value of the control.
- (See GpiSetDrawControl for details):
- DCTL_OFF
- Off
- DCTL_ON
- On
- DCTL_ERROR
- Error.
Remarks
This function returns the current state of a specified drawing control.
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_DRAW_CONTROL (0x2063)
- An invalid control parameter was specified with GpiSetDrawControl or GpiQueryDrawControl.
- PMERR_INV_MICROPS_DRAW_CONTROL (0x20A0)
- A draw control parameter was specified with GpiSetDrawControl that is invalid in a micro presentation space.
Example Code
#define INCL_GPICONTROL /* Or use INCL_GPI, INCL_PM, */ #include <os2.h> HPS hps; /* Presentation-space handle. */ LONG lControl; /* Control whose value is to be returned. */ LONG lValue; /* Value of the control. */ lValue = GpiQueryDrawControl(hps, lControl);
This example uses GpiQueryDrawControl to return the value for the Display drawing control as set by GpiSetDrawControl.
#define INCL_GPICONTROL /* Control functions */ #include <os2.h> LONG lValue; /* value of the control */ HPS hps; /* Presentation-space handle */ LONG lControl; /* control value to be queried */ /* ask for Display control value */ lControl = DCTL_DISPLAY; lValue = GpiQueryDrawControl(hps, lControl);