Personalized Icons for Devices on Windows XP

Updated: January 13, 2003
*
On This Page
IntroductionIntroduction
Creating Icons Based on Windows XP Design GuidelinesCreating Icons Based on Windows XP Design Guidelines
Including Icons in Device Driver PackagesIncluding Icons in Device Driver Packages
Call to Action and ResourcesCall to Action and Resources

Introduction

Device manufacturers can create personalized, or custom, product icons and include them in their driver packages so that the end-user sees an icon that resembles the actual device. These personalized icons will be visible in the Autoplay window and in My Computer under the Windows operating system.

This article summarizes the key information for creating custom icons and including such icons in a driver package. The information in this article applies to devices and drivers designed to work with Microsoft Windows XP, Windows XP Embedded, and Windows Server 2003.

Top of pageTop of page

Creating Icons Based on Windows XP Design Guidelines

The Microsoft publication Creating Windows XP Icons provides step-by-step guidelines for creating icons that have the "look and feel" of Windows XP graphical elements.

The key elements for custom icon design for Windows XP include:

Icon design incorporates Windows XP style characteristics.

Icon is provided in at least 48 x 48, 32 x 32, and 16 x 16 pixel sizes. If the icon is to be provided for a tool bar, also provided 24 x 24 pixel size.

Each icon contains at least these color depths to support different display settings:
24-bit with 8-bit alpha (32-bit)
8-bit (256 colors) with 1-bit transparency
4-bit (16 colors) with 1-bit transparency

Icon uses the primary colors from the Windows XP color palette.

Icon uses the Windows XP icon perspective and includes a drop shadow and an outline to provide definition and dimension.

Creating Windows XP Icons is available at: http://msdn2.microsoft.com/en-us/library/ms997636.aspx.

Top of pageTop of page

Including Icons in Device Driver Packages

Note: The following information will be included in a future version of the Windows DDK.

Once you have created a custom icon for a device, you can include the icon in the device driver package by referencing it in the INF file. The DDInstall.HW section is used to set driver-independent information that is device-specific.

In the sample INF sections that follow, the DDInstall.HW section points to a separate AddReg section, which specifies the personalized icons.

[DDInstall.NT.HW]
AddReg = IconInformation
[IconInformation]
HKR, , Icons, 0x10000, "<name of icon file>"
HKR, , NoMediaIcons, 0x10000, "<name of no media icon file>"

The AddReg section in this example defines two separate registry values and corresponding icon files, one for the custom icon to display when media is present, and a second, "NoMediaIcons," which specifies an icon to be used to indicate the same device when no media is inserted.

The following example shows the registry entries for a Vid_0000&Pid_0000 device and the dynamic-link library (DLL) files that contain the "media inserted" and "no media" versions of the icon.

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

In the INF file, icon files must be listed in the [SourceDisksFiles] section within the INF file, and copied to the user's system by either a CopyFiles directive or a CopyFiles section.

During driver installation, the INF entries listed in the example will be stored in the Device Parameters subkey within HKLM\System\CurrentControlSet\Enum.

Drivers or other code should never access or modify this registry key directly; instead, use one of the following APIs:

From user-mode, use SetupDiCreateDevRegKey and SetupDiOpenDevRegKey.

From kernel-mode, use IoOpenDeviceRegistryKey.

For information about the INF entries cited here, see the Device Installation Reference in the current Windows DDK.

Top of pageTop of page

Call to Action and Resources

Call to action for creating personalized device icons:

Include personalized icons with your driver packages by adding appropriate entries to the INF file.

Never access registry keys directly, use the appropriate APIs as described in this paper.

Develop personalized icons using the design guidelines provided in Creating Windows XP Icons, available at: http://msdn2.microsoft.com/en-us/library/ms997636.aspx.

Feedback:

To provide feedback about creating personalized icons for devices, please send e-mail to wudriver@microsoft.com with "Personalized Device Icons" in the Subject line.

Resources:

For more information on setting device icons on a per-Device Group or per-Device Class basis, see "Preparing Hardware and Software for Use with AutoPlay" in the Platform SDK Documentation, available at:
http://msdn2.microsoft.com/en-us/library/aa969331.aspx

For more information about Windows Update and submission process, see How to Publish Drivers on Windows Update.

Windows Driver Development Kit


Top of pageTop of page