GpiQueryCurrentPosition: Difference between revisions
Appearance
mNo edit summary |
|||
Line 1: | Line 1: | ||
This function returns the value of current position. | |||
This function returns the value of current position. | |||
==Syntax== | ==Syntax== | ||
GpiQueryCurrentPosition(hps, pptlPoint) | |||
==Parameters== | ==Parameters== | ||
; | ;hps (HPS) - input: Presentation-space handle. | ||
;pptlPoint (PPOINTL) - output: Current position. | |||
; pptlPoint (PPOINTL) - output : Current position. | |||
==Return Code== | ==Return Code== | ||
; | ;rc (BOOL) - returns: Success indicator. | ||
*TRUE - Successful completion | |||
* TRUE | *FALSE - Error occurred. | ||
* FALSE | |||
===Errors=== | ===Errors=== | ||
Possible returns from WinGetLastError | Possible returns from WinGetLastError: | ||
;PMERR_INV_HPS (0x207F) : An invalid presentation-space handle was specified. | |||
; 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_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_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. | ||
; 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== | ==Remarks== | ||
This function is invalid when the drawing mode (see GpiSetDrawingMode) is set to retain. | This function is invalid when the drawing mode (see [[GpiSetDrawingMode]]) is set to retain. | ||
==Example Code== | ==Example Code== | ||
This example uses GpiQueryCurrentPosition to return the value of the current position and assigns the x coordinate to a variable. | This example uses GpiQueryCurrentPosition to return the value of the current position and assigns the x coordinate to a variable. | ||
<pre> | <pre> | ||
#define INCL_GPIPRIMITIVES /* Primitive functions */ | #define INCL_GPIPRIMITIVES /* Primitive functions */ | ||
Line 52: | Line 39: | ||
lxCoord = pptlPoint.x; | lxCoord = pptlPoint.x; | ||
</pre> | </pre> | ||
[[Category:Gpi]] | [[Category:Gpi]] |
Latest revision as of 12:22, 26 June 2021
This function returns the value of current position.
Syntax
GpiQueryCurrentPosition(hps, pptlPoint)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- pptlPoint (PPOINTL) - output
- Current position.
Return Code
- rc (BOOL) - returns
- Success indicator.
- TRUE - Successful completion
- FALSE - Error occurred.
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
This example uses GpiQueryCurrentPosition to return the value of the current position and assigns the x coordinate to a variable.
#define INCL_GPIPRIMITIVES /* Primitive functions */ #include <os2.h> BOOL fSuccess; /* success indicator */ HPS hps; /* Presentation-space handle */ POINTL pptlPoint; /* current position */ LONG lxCoord; /* current position x coordinate */ fSuccess = GpiQueryCurrentPosition(hps, &pptlPoint); if (fSuccess == TRUE) lxCoord = pptlPoint.x;