Jump to content

GpiQuerySegmentAttrs: Difference between revisions

From EDM2
Created page with "This function returns the current value of the specified attribute as set by the GpiSetSegmentAttrs function. ==Syntax== GpiQuerySegmentAttrs(hps, lSegid, lAttribute) ==Parameters== ; hps (HPS) - input : Presentation-space handle. ; lSegid (LONG) - input : Segment identifier; must be greater than 0. : The name of the segment for which attribute information is to be returned. ; lAttribute (LONG) - input : Attribute to be queried. : For details of the..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 5: Line 5:


==Parameters==
==Parameters==
; hps ([[HPS]]) - input
; hps ([[HPS]]) - input: Presentation-space handle.
: Presentation-space handle.
; lSegid ([[LONG]]) - input: Segment identifier; must be greater than 0.
 
; lSegid ([[LONG]]) - input
: Segment identifier; must be greater than 0.
: The name of the segment for which attribute information is to be returned.
: The name of the segment for which attribute information is to be returned.
 
; lAttribute ([[LONG]]) - input: Attribute to be queried.
; lAttribute ([[LONG]]) - input
: Attribute to be queried.
: For details of the following attributes, see the [[GpiSetInitialSegmentAttrs]] function.
: For details of the following attributes, see the [[GpiSetInitialSegmentAttrs]] function.
: Identifies the attribute of the segment to be returned by this function:
: Identifies the attribute of the segment to be returned by this function:
:; ATTR_DETECTABLE
:: ATTR_DETECTABLE : Detectability
:: Detectability
:: ATTR_VISIBLE : Visibility
:; ATTR_VISIBLE
:: ATTR_CHAINED : Chained
:: Visibility
:: ATTR_DYNAMIC : Dynamic
:; ATTR_CHAINED
:: ATTR_FASTCHAIN : Fast chaining
:: Chained
:: ATTR_PROP_DETECTABLE : Propagate detectability
:; ATTR_DYNAMIC
:: ATTR_PROP_VISIBLE : Propagate visibility.
:: Dynamic
:; ATTR_FASTCHAIN
:: Fast chaining
:; ATTR_PROP_DETECTABLE
:: Propagate detectability
:; ATTR_PROP_VISIBLE
:: Propagate visibility.


==Return Value==
==Return Value==
; lValue ([[LONG]]) - returns
; lValue ([[LONG]]) - returns: Current attribute value.
: Current attribute value.
:: ATTR_ON : On/yes
:; ATTR_ON
:: ATTR_OFF : Off/no
:: On/yes
:: ATTR_ERROR : Error.
:; ATTR_OFF
:: Off/no
:; ATTR_ERROR
:: Error.


==Remarks==
==Remarks==
Line 46: Line 30:
==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)
; PMERR_INV_SEG_NAME (0x20C8): An invalid segment identifier was specified.
: An attempt was made to access the presentation space from more than one thread simultaneously.
; PMERR_INV_SEG_ATTR (0x20C5): An invalid attribute parameter was specified with [[GpiSetSegmentAttrs]], GpiQuerySegmentAttrs, [[GpiSetInitialSegmentAttrs]], or [[GpiQueryInitialSegmentAttrs]].
; PMERR_INV_SEG_NAME (0x20C8)
; PMERR_SEG_NOT_FOUND (0x2100): The specified segment identifier did not exist.
: An invalid segment identifier was specified.
; PMERR_INV_MICROPS_FUNCTION (0x20A1): An attempt was made to issue a function that is invalid in a micro presentation space.
; PMERR_INV_SEG_ATTR (0x20C5)
: An invalid attribute parameter was specified with [[GpiSetSegmentAttrs]], GpiQuerySegmentAttrs, [[GpiSetInitialSegmentAttrs]], or [[GpiQueryInitialSegmentAttrs]].
; PMERR_SEG_NOT_FOUND (0x2100)
: The specified segment identifier did not exist.
; PMERR_INV_MICROPS_FUNCTION (0x20A1)
: An attempt was made to issue a function that is invalid in a micro presentation space.


==Example Code==
==Example Code==
<PRE>
#define INCL_GPISEGMENTS /* Or use INCL_GPI, INCL_PM, */
#include &lt;os2.h&gt;
HPS  hps;        /* Presentation-space handle. */
LONG lSegid;    /* Segment identifier; must be greater than 0. */
LONG lAttribute; /* Attribute to be queried. */
LONG lValue;    /* Current attribute value. */
lValue = GpiQuerySegmentAttrs(hps, lSegid, lAttribute);
</PRE>
This function is used to query the current value of the specified attribute.
This function is used to query the current value of the specified attribute.
<pre>
<pre>
#define INCL_GPISEGMENTS
#define INCL_GPISEGMENTS
#include &lt;OS2.H&gt;
#include <OS2.H>


LONG lSegid; /* Segment identifier must */
LONG lSegid; /* Segment identifier must */
LONG lValue; /* be greater than 0. */
LONG lValue; /* be greater than 0. */
LONG lattribute; /* attribute to be queried */
LONG lattribute; /* attribute to be queried */
HPS hps; /* Presentation-space */
HPS hps; /* Presentation-space handle. */
/* handle. */


lattribute = ATTR_VISIBLE;
lattribute = ATTR_VISIBLE;

Latest revision as of 00:34, 24 November 2025

This function returns the current value of the specified attribute as set by the GpiSetSegmentAttrs function.

Syntax

GpiQuerySegmentAttrs(hps, lSegid, lAttribute)

Parameters

hps (HPS) - input
Presentation-space handle.
lSegid (LONG) - input
Segment identifier; must be greater than 0.
The name of the segment for which attribute information is to be returned.
lAttribute (LONG) - input
Attribute to be queried.
For details of the following attributes, see the GpiSetInitialSegmentAttrs function.
Identifies the attribute of the segment to be returned by this function:
ATTR_DETECTABLE : Detectability
ATTR_VISIBLE : Visibility
ATTR_CHAINED : Chained
ATTR_DYNAMIC : Dynamic
ATTR_FASTCHAIN : Fast chaining
ATTR_PROP_DETECTABLE : Propagate detectability
ATTR_PROP_VISIBLE : Propagate visibility.

Return Value

lValue (LONG) - returns
Current attribute value.
ATTR_ON : On/yes
ATTR_OFF : Off/no
ATTR_ERROR : Error.

Remarks

The segment can be any retained segment, including the currently open one if this is retained.

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_SEG_NAME (0x20C8)
An invalid segment identifier was specified.
PMERR_INV_SEG_ATTR (0x20C5)
An invalid attribute parameter was specified with GpiSetSegmentAttrs, GpiQuerySegmentAttrs, GpiSetInitialSegmentAttrs, or GpiQueryInitialSegmentAttrs.
PMERR_SEG_NOT_FOUND (0x2100)
The specified segment identifier did not exist.
PMERR_INV_MICROPS_FUNCTION (0x20A1)
An attempt was made to issue a function that is invalid in a micro presentation space.

Example Code

This function is used to query the current value of the specified attribute.

#define INCL_GPISEGMENTS
#include <OS2.H>

LONG lSegid; /* Segment identifier must */
LONG lValue; /* be greater than 0. */
LONG lattribute; /* attribute to be queried */
HPS hps; /* Presentation-space handle. */

lattribute = ATTR_VISIBLE;

lValue = GpiQuerySegmentAttrs(hps,
    lSegid,
    lattribute);

Related Functions