Jump to content

GpiQueryGraphicsField: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
 
Line 37: Line 37:
   lLwrLftxCoord = prclField.xLeft;
   lLwrLftxCoord = prclField.xLeft;
</pre>
</pre>
==Related Functions==


[[Category:Gpi]]
[[Category:Gpi]]

Latest revision as of 23:46, 7 April 2025

This function returns the bottom-left and top-right corners of the graphics field in presentation page units, as set by the GpiSetGraphicsField function.

Syntax

GpiQueryGraphicsField(hps, prclField)

Parameters

hps (HPS) - input
Presentation-space handle.
prclField (PRECTL) - output
Graphics field.

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.

Remarks

Example Code

This example uses GpiQueryGraphicsField to return the bottom-left and top-right corners of the graphics field in presentation page units, as set by the GpiSetGraphicsField call, and then assigns the x coordinate of the lower left hand field corner to a variable.

#define INCL_GPITRANSFORMS /* Transform functions */
#include <os2.h>

BOOL fSuccess; /* success indicator */
HPS hps; /* Presentation-space handle */
RECTL prclField; /* graphics field */
LONG lLwrLftxCoord; /* lower left x coordinate of field */

fSuccess = GpiQueryGraphicsField(hps, &prclField);

/* if successful, assign lower left x coordinate of graphics field */
if (fSuccess == TRUE)
   lLwrLftxCoord = prclField.xLeft;