Standard Properties

OLE defines a set of standard DISPIDs for all three kinds of properties: control, ambient, and extended. The following tables list these standards for control properties, ambient properties, and extended properties.

Control property Type Description
BackColor, ForeColor, FillColor, BorderColor
OLE_COLOR
The control's color scheme
BackStyle, FillStyle, BorderStyle, BorderWidth, BorderVisible, DrawStyle, DrawWidth
short or long
Bits that define a control's visual behavior, such as being solid or transparent, having thick or thin borders, line styles, and so forth.
Font
IDispatch *
The font used in the control, which is an IDispatch pointer to a standard font object. See Standard Font Object for more information.
Caption, Text
BSTR
Strings containing the control's label (the caption) or its textual contents (the text). Note that the caption does not necessarily name the control in the container. See the extended Name property in the following table.
Enabled
BOOL
Determines whether the control is enabled or disabled. If disabled, the control is probably grayed.
Window
HWND
The window handle of the control, if it has one.
TabStop
BOOL
Determines whether this control is a tab stop.
Ambient property Type Description
BackColor, ForeColor
OLE_COLOR
Provides controls with the default background and foreground colors. Use by a control is optional.
Font
IDispatch *
A pointer to a standard font object that defines the default font for the form. Use by a control is optional. See Standard Font Object for more information.
LocaleID
LCID
The language used in the container. Use by a control is recommended.
UserMode
BOOL
Describes whether the container is in a design mode (FALSE) or run-mode (TRUE), which a control should use to change its available functionality as necessary.
UIDead
BOOL
Describes whether the container is in a mode where controls should ignore user input. This applies irrespective of UserMode. A container might always set UIDead to TRUE in design mode, and may set it to TRUE when it has hit a breakpoint or such during run mode. A control must pay attention to this property.
MessageReflect
BOOL
Specifies whether the container would like to receive Windows messages such as WM_CTLCOLOR, WM_DRAWITEM, WM_PARENTNOTIFY, and so on as events.
SupportsMnemonics
BOOL
Describes whether the container processes mnemonics or not. A control can do whatever it wants with this information, such as not underline characters it would normally use as a mnemonic.
ShowGrabHandles, ShowHatching
BOOL
Describes whether a control should show a hatch border or grab handles (in the hatch border) when in-place active. Controls must obey these properties, giving the container ultimate control over who actually draws these bits of user interface. A control container may want to draw its own instead of relying on each control, in which case these ambients will always be FALSE.
DisplayAsDefault
BOOL
The container will expose a TRUE for this property through whatever site contains what is marked as the default button when the button control should draw itself with a thicker default frame.
Extended property Type Description
Name
BSTR
The container's name for the control.
Visible
BOOL
The control's visibility.
Parent
IDispatch *
The dispinterface of the form containing the control.
Default, Cancel
BOOL
Indicates if this control is the default or cancel button.

All of these standard properties have negative DISPID values, indicating their standard status.

Note that to avoid conflicts in the programmatic symbols for these DISPIDs, all ambient properties are given symbols in the form DISPID_AMBIENT_property as in DISPID_AMBIENT_FORECOLOR. All other symbols use DISPID_property as usual.

Some ambient properties, as well as control properties, involve colors. The OLE_COLOR type mentioned in the previous tables can refer to a standard COLORREF type, an index to a palette, a palette-relative index, or a system color index used with the GetSysColor function. The OleTranslateColor function converts an OLE_COLOR type to a COLORREF type given a palette.

Control Properties