大网数据广告活动
域与目录服务

Class Icons

· 52CE 我爱测

The icon used to represent a class object can be specified in the iconPath attribute in the DisplaySpecifiers container.

The icon used to represent a class object can be specified in the iconPath attribute in the DisplaySpecifiers container. Moreover, each class can store multiple icon states. For example, a folder class can have icons for the open, closed, and disabled states. The current implementation accepts a maximum of sixteen different icon states per class.

The iconPath attribute can be specified in one of two ways.

<state>,<icon file name>

or

<state>,<module file name>,<resource ID>

In these examples, the "<state>" is an integer with a value between 0 and 15. The value 0 is defined to be the default or closed state of the icon. The value 1 is defined to be the open state of the icon. The value 2 is the disabled state. All other values are application-defined.

The "<icon file name>" is the path and file name of an icon file that contains the icon image.

The "<module file name>" is the path and file name of a module, such as an EXE or DLL, that contains the icon image in a resource. The "<resource ID>" is an integer that specifies the resource identifier of the icon resource within the module.

Adding a Value to the iconPath Attribute

To add a value to the iconPath attribute, perform the following steps.

  1. Determine if the value for the attribute exists. If a value is to be replaced, first, delete the existing value using the IADs::PutEx method with the lnControlCode parameter set to ADS_PROPERTY_DELETE and the vProp parameter set to the value to be removed. Do not use ADS_PROPERTY_CLEAR or ADS_PROPERTY_UPDATE for lnControlCode.
  2. Create the string that represents the attribute icon data. For an example, see the format above.
  3. To add the new value, use the IADs::PutEx method with the lnControlCode parameter set to ADS_PROPERTY_APPEND.
  4. To commit changes to the directory, call IADs::SetInfo.

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)

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

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