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.

If an updated driver package that contains a custom icon is posted on Windows Update, the user is prompted that a new download is available.

There are two steps to including icon files in a driver package:

  1. Add the icon files to the driver package.

  2. 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

  • 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 direct Windows to copy the icon files 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.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_0000&Pid_0000\059B003112010E93\Device Parameters

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:

 

 

Send comments about this topic to Microsoft

显示:
© 2014 Microsoft