Previous Next

Providing Vendor Icons for the Shell and AutoPlay

AutoPlay is an extension of the Shell that is supported by Microsoft® Windows® XP and later versions. You can use AutoPlay to detect different types of content, such as audio or video files, on removable media or removable devices. You can display custom icons for content and devices, and you can automatically launch an application to play or display content when the system detects a medium or device. For more information about AutoPlay, see the AutoPlay Web site.

This section describes how you can provide custom icons for a device. The Shell and AutoPlay use these icons to depict the device in the AutoPlay dialogs, My Computer, and File Open dialogs. The icons indicate whether or not a device is present, and whether or not a medium is inserted. You can provide two different icons:

You provide the icons for a device by adding them to the device's driver package. If an updated driver package that contains a custom icon is posted on Windows Update, Windows Update offers this update to users by signaling that a new download is available.

Creating Vendor Icons

The MSDN guidelines provided in Creating Windows XP Icons describe how to create icons that have the look and feel of Windows XP graphical elements.

Including Icons in a Device Driver Package

To specify the icons in the device's INF file, include an INF AddReg directive under an INF DDInstall.HW section for the device. In the AddReg section, specify Icons and NoMediaIcons value entries, as indicated in the following example:

[DDInstall.NT.HW]
AddReg = IconInformation

[IconInformation]
HKR, , Icons, 0x10000, “media-inserted-icon-file”
HKR, , NoMediaIcons, 0x10000, “no-media-inserted-icon-file
Icons
Specifies the name of the file that contains the media-inserted icon. The media-inserted-icon-file value is a placeholder for the actual file name.
NoMediaIcons
Specifies the name of the file that contains the no-media-inserted icon. The no-media-inserted-icon-file value is a placeholder for the actual file name.

To copy the icon files to the system, list the files in the INF SourceDisksFiles section within the INF file, and copy them to the user’s system by using an INF CopyFiles directive.

During driver installation, the Icons and NoMediaIcons value entries are stored under the Device Parameters key under the device's hardware key. Drivers or other code should never access or modify this registry key directly. Instead, you should use the following system functions:

In addition to specifying icons for individual devices, you can also specify icons for all devices in a user-defined device group or a device setup class. For information about this topic, see the Preparing Hardware and Software for Use with AutoPlay Web site.