GreDeviceSetGlobalAttribute
Appearance
GreDeviceSetGlobalAttribute sets the individual primitive attributes to the specified value in the line, area, character, image, and marker bundles.
This function must be supported by the presentation driver.
- Simulation support
- None. This function is mandatory for all drivers.
Syntax
GreDeviceSetGlobalAttribute(hdc, lAttrType, lAttribute, flOptions, pInstance, lFunction);
Parameters
- hdc (HDC) - input
- Device context handle.
- lAttrType (LONG) - input
- Specifies the attribute.
- Possible attribute types are:
- ATYPE_COLOR Foreground color
- ATYPE_BACK_COLOR Background color
- ATYPE_MIX_MODE Foreground mix
- ATYPE_BACK_MIX_MODE Background mix ATYPE_BACK_COLOR and ATYPE_BACK_MIX_MODE do not apply to the line bundle.
- lAttribute (LONG) - input
- New attribute value.
- flOptions (ULONG) - input
- Options flag.
- The only allowable option is:
- GATTR_DEFAULT When set, the attribute indicated by lAttrType is set to its default value. When this flag is not set, the attribute is set to the value of lAttribute.
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGreDeviceSetGlobalAttribute.
Returns
- rc (BOOL) - returns
- Return Codes.
- On completion, the handling routine must return a BOOLEAN value to indicate success or an error.
- TRUE Successful
- FALSE Error
- Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:
- PMERR_DEV_FUNC_NOT_INSTALLED
- PMERR_INV_BACKGROUND_COL_ATTR
- PMERR_INV_BACKGROUND_MIX_ATTR
- PMERR_INV_COLOR_ATTR
- PMERR_INV_HDC
- PMERR_INV_MIX_ATTR
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.
Sample
#define INCL_GRE_DEVMISC1 #include <os2.h> HDC hdc; /* Device context handle. */ LONG lAttrType; /* Specifies the attribute. */ LONG lAttribute; /* New attribute value. */ ULONG flOptions; /* Options flag. */ PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; BOOL rc; /* Return Codes. */ rc = GreDeviceSetGlobalAttribute(hdc, lAttrType, lAttribute, flOptions, pInstance, lFunction);
Remarks
If this call sets any attributes to a value that is not in the defined range of values for that attribute, the handling routine must restore all attributes to the value they had on entry to this routine.