大网数据广告活动
Windows 系统接口

Standard Properties

· 52CE 我爱测

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.

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.

Related topics

Control Properties

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。