Jump to content

GpiQueryPS: Difference between revisions

From EDM2
Created page with "This function returns page parameters for the presentation space. ==Syntax== lOptions = GpiQueryPS(HPS ''hps'', PSIZEL ''psizlSize'') ==Parameters== ;''hps'' (HPS) - input..."
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This function returns page parameters for the presentation space.  
This function returns page parameters for the presentation space.
 
==Syntax==
==Syntax==
  lOptions = GpiQueryPS(HPS ''hps'', PSIZEL ''psizlSize'')
  GpiQueryPS(hps, psizlSize)


==Parameters==  
==Parameters==
;''hps'' (HPS) - input
;''hps'' ([[HPS]]) - input:Presentation-space handle.
:Presentation-space handle.  
;''psizlSize'' (P[[SIZEL]]) - output:Presentation-page size.
 
;''psizlSize'' (PSIZEL) - output
:Presentation-page size.


==Returns==
==Returns==
;''lOptions'' (ULONG) - returns
;''lOptions'' (ULONG) - returns:Presentation-space options.
:Presentation-space options.
:For details, see the [[GpiCreatePS]] function.
: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 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.
: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
::PS_UNITS : Presentation-space size units
:: Presentation-space size units  
::PS_FORMAT : Presentation-space coordinate format
:;PS_FORMAT
::PS_TYPE : Presentation-space type
:: Presentation-space coordinate format  
::PS_MODE : Presentation-space mode.
:;PS_TYPE
 
:: Presentation-space type  
:;PS_MODE
:: Presentation-space mode.
==Errors==
==Errors==
Possible returns from WinGetLastError
Possible returns from WinGetLastError
;PMERR_INV_HPS (0x207F)
;PMERR_INV_HPS (0x207F) :An invalid presentation-space handle was specified.
: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.
 


==Example Code==
==Example Code==
Definition:
<pre>
#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);
</pre>
In this example we query the presentation space that corresponds to handle hps.
In this example we query the presentation space that corresponds to handle hps.
<pre>
<pre>
#define INCL_GPICONTROL
#define INCL_GPICONTROL
#include <OS2.H>
#include <os2.h>
HPS hps;
HPS hps;
SIZEL sizel;
SIZEL sizel;

Latest revision as of 23:56, 23 April 2025

This function returns page parameters for the presentation space.

Syntax

GpiQueryPS(hps, 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

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);