Jump to content

GpiQuerySegmentAttrs

From EDM2
Revision as of 00:34, 24 November 2025 by Ak120 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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