The wpCnrSetEmphasis method provides a way to change the visual emphasis of an object. Visual emphasis can be used to give the user feedback as to the state of the object. For example, when a folder is opened on the Desktop, in-use emphasis is added to the folder icon. The Workplace Shell accomplishes this by calling wpCnrSetEmphasis on the object.
This method sends the CM_SETRECORDEMPHASIS message to the container. The CRA_* flags that are specified for the ulEmphasisAttr parameter are the same as those for the CM_SETRECORDEMPHASIS container message. The following shows the syntax of wpCnrSetEmphasis:
#define INCL_WINWORKPLACE #include <os2.h> BOOL wpCnrSetEmphasis (WPObject *self, ULONG ulEmphasisAttr, BOOL fTurnOn)
The self (WPObject *) parameter is the pointer to the object on which the method is being invoked. It points to an object of class WPObject.
The ulEmphasisAttr (ULONG) parameter is the type of emphasis to set on the object. The CRA_* flags are as follows. These flags are the container's record attribute flags. The flags may be combined using the logical OR ( | ) operator.
Emphasis Type
The fTurnOn (BOOL) parameter sets or resets the specified attribute.
Boolean
rc (BOOL) is returned with one of the following values:
Boolean
The following figure shows how to set the emphasis on a container object:
/************************************************************************//* This sample code assumes that the object has already been created */ /* using wpclsNew and object's pointer has been obtained */ /* using wpclsQueryObject. */ /************************************************************************/ WPObject *self; /* The object whose emphasis is being set */ ULONG ulEmphasis; /* ULONG data structure */ ulEmphasis = CRA_INUSE; /* Emphasis type desired */ /************************************************************************/ /* Setting emphasis on the object. */ /************************************************************************/ _wpCnrSetEmphasis(self, ulEmphasis, TRUE);