Jump to content

GpiQueryPickAperturePosition

From EDM2
Revision as of 03:55, 20 December 2016 by Martini (talk | contribs) (Example Code)

Description

This function returns the position of the center of the pick aperture.

Syntax

#define INCL_GPICORRELATION /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>

HPS hps; /* Presentation-space handle. */
PPOINTL pptlPoint; /* Pick-aperture position. */
BOOL rc; /* Success indicator. */

rc = GpiQueryPickAperturePosition(hps, pptlPoint);

Parameters

hps (HPS) - input
Presentation-space handle.
pptlPoint (PPOINTL) - output
Pick-aperture position.

Position of the center of the pick aperture, in presentation-page coordinates.

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_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

Example Code

In this example we query the position of the center of the pick aperture.

#define INCL_GPICORELATION
#include <OS2.H>

BOOL flResult;
HPS hps; /* Presentation space handle. */
POINTL ptlRefPoint; /* Pick-aperture position. */
LONG xcoord, ycoord;
flResult = GpiPickAperturePosition(hps, &ptlRefPoint);
xcoord = ptlRefPoint.x; ycoord = ptlRefPoint.y;

Related Functions