gpi12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
GpiSetAttrMode (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPIPRIMITIVES
 
BOOL GpiSetAttrMode(hps, cmdMode)
HPS hps;         /* presentation-space handle */
LONG cmdMode;    /* attribute mode            */
 
The GpiSetAttrMode function sets the current attribute mode. If the
attribute mode is AM_PRESERVE, the system saves the old value of a primitive
attribute whenever the attribute is changed to a new value. The saved value
of an attribute can be restored by using the GpiPop function. Any attributes
that have been saved in a called segment are automatically restored on
return to the caller.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hps        Identifies the presentation space.
 
cmdMode    Specifies the attribute mode. It can be one of the following
           values:
 
           Value          Meaning
           ─────────────────────────────────────────────────────────────────
           AM_PRESERVE    Preserve attributes.
 
           AM_NOPRESERVE  Do not preserve attributes.
 
Return Value
 
The return value is GPI_OK if the function is successful or GPI_ERROR if an
error occurred.
 
Errors
 
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
 
     PMERR_INV_ATTR_MODE
     PMERR_INV_HPS
     PMERR_INV_MICROPS_FUNCTION
     PMERR_PS_BUSY
 
Comments
 
The attribute mode is an API mode, meaning it does not affect
attribute-setting functions that have been stored in a segment. The mode
used for functions stored in a segment is the mode in effect when the
function was stored. This is also true for any attribute-setting functions
that are part of the graphics-order data in a GpiPutData, GpiElement, or
GpiPlayMetaFile function.
 
See Also
 
GpiElement, GpiPlayMetaFile, GpiPop, GpiPutData, GpiSetAttrs, GpiSetColor,
WinGetLastError