GreGetDefaultAttributes

From EDM2
Jump to: navigation, search

GreGetDefaultAttributes returns the default values of the attributes indicated in flAttrsMask.

This function is supported by the graphics engine.

Syntax

GreGetDefaultAttributes(hdc, lPrimType, flAttrsMask, pAttrs, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
lPrimType (LONG) - input
Bundle primitive type.
Indicates the bundle type. Valid primitive values are:
PRIM_LINE: Line attribute bundle
PRIM_CHAR: Character attribute bundle
PRIM_MARKER: Marker attribute bundle
PRIM_AREA :Pattern attribute bundle
PRIM_IMAGE: Image attribute bundle
flAttrsMask (ULONG) - input
Attribute mask.
Specifies the attributes to be returned corresponding to each attribute in the bundle record. For each set bit, the engine returns the corresponding attribute values and default mask bits.
pAttrs (PBUNDLE) - input
Pointer to the fixed format bundle record containing the attributes returned.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreGetDefaultAttributes.

Return Code

rc (BOOL) - returns
This function returns the default attribute bit mask. Only bits with corresponding set bits in flAttrsMask are updated. Otherwise, this function returns the error, ATTRS_ERROR.
Possible Errors Detected: When an error is detected, the graphics engine calls WinSetErrorInfo to post the condition. Reasons for failure of this function include:
  • PMERR_HDC_BUSY
  • PMERR_INV_HDC
Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation.

Sample Code

#define INCL_GRE_DEVSUPPORT
#include <os2.h>

HDC        hdc;          /*  Device context handle. */
LONG       lPrimType;    /*  Bundle primitive type. */
ULONG      flAttrsMask;  /*  Attribute mask. */
PBUNDLE    pAttrs;
PVOID      pInstance;    /*  Pointer to instance data. */
ULONG      lFunction;
BOOL       rc;

rc = GreGetDefaultAttributes(hdc, lPrimType,
       flAttrsMask, pAttrs, pInstance, lFunction);