Jump to content

GpiQueryPS

From EDM2
Revision as of 04:33, 25 November 2023 by Martini (talk | contribs) (Created page with "This function returns page parameters for the presentation space. ==Syntax== lOptions = GpiQueryPS(HPS ''hps'', PSIZEL ''psizlSize'') ==Parameters== ;''hps'' (HPS) - input...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function returns page parameters for the presentation space.

Syntax

lOptions = GpiQueryPS(HPS hps, PSIZEL psizlSize)

Parameters

hps (HPS) - input
Presentation-space handle.
psizlSize (PSIZEL) - output
Presentation-page size.

Returns

lOptions (ULONG) - returns
Presentation-space options.
For details, see the GpiCreatePS function.
The individual fields of the presentation-space options can be extracted by ANDing the returned value with the appropriate constant.
The PS_ASSOCIATE field of flOptions (see GpiCreatePS) should not be used on this function. The value of this field is not necessarily the same value that is specified when the presentation space is created.
PS_UNITS
Presentation-space size units
PS_FORMAT
Presentation-space coordinate format
PS_TYPE
Presentation-space type
PS_MODE
Presentation-space mode.

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.


Example Code

Definition:

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

HPS       hps;        /*  Presentation-space handle. */
PSIZEL    psizlSize;  /*  Presentation-page size. */
ULONG     lOptions;   /*  Presentation-space options. */

lOptions = GpiQueryPS(hps, psizlSize);

In this example we query the presentation space that corresponds to handle hps.

#define INCL_GPICONTROL
#include <OS2.H>
HPS hps;
SIZEL sizel;

GpiQueryPS(hps, &sizel);