Providing Vendor Icons for the Shell and AutoPlay
AutoPlay is an extension of the Shell, and is supported by Microsoft Windows XP and later versions of Windows. AutoPlay detects different types of content, such as audio or video files, on removable media or removable devices. AutoPlay can display custom icons for content and devices, and it can automatically start an application to play or display content when the system detects a medium or device.
This topic describes how you can provide custom icons for a device. The Shell and AutoPlay use these icons to represent the device in the AutoPlay, My Computer, and file Open dialog boxes. The icons indicate whether a device is present and whether a medium is inserted. You can provide the following icons:
The media-inserted icon indicates that the device is present and a medium is inserted.
The no-media-inserted icon indicates that the device is present but a medium is not inserted.
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 more information, see the Preparing Hardware and Software for Use with AutoPlay website.
There are two steps to including icon files in a driver package:
Add the icon files to the driver package.
In the package's INF file, add entries that specify the icon files and copy them to the system.
If a system-supplied driver handles your device, you do not have to supply a full driver package. You only have to provide an INF file and the icon files. This INF file must include the required icon-specific entries, plus Include and Needs entries that refer to your device's installation sections in the system-supplied driver's INF file.
To create icons
- Follow the MSDN guidelines that are provided at the Creating Windows XP Icons website. These guidelines describe how to create icons that have the appearance and behavior of Windows XP graphical elements.
To specify the icons in an INF file
[DDInstall.NT.HW] AddReg = IconInformation [IconInformation] HKR, , Icons, 0x10000, "media-inserted-icon-file" HKR, , NoMediaIcons, 0x10000, "no-media-inserted-icon-file"
To direct Windows to copy the icon files to the system
- Include an INF SourceDisksFiles section that lists the icon files and a corresponding INF CopyFiles directive that copies them to the system.
Windows saves the Icons and NoMediaIcons value entries under the Device Parameters key under the device's hardware key. The following example specifies the registry location, value-entry-type, and value of the Icons and NoMediaIcons value entries for the device whose device instance ID is USB\Vid_0000&Pid_0000\059B003112010E93.
Icons [REG_MULTI_SZ] = %SystemRoot%\system32\icon.ico
NoMediaIcons [REG_MULTI_SZ] = %SystemRoot%\system32\noicon.ico
Drivers or other code should never access or modify the Device Parameters key directly. Instead, you should use the following system functions: