Control Panel Categories
--------------------------------------------------------------------------------
The Microsoft® Windows® XP Control Panel now supports categorization of Control Panel applications. Windows XP also has support for third parties to add Control Panel applications to categories.
Registering a Control Panel Application in a Category
You can register a Control Panel application in a particular category by adding a REG_DWORD entry indicating the desired category to the registry. The following example registry entry assigns the application MyCPL.cpl to the category Appearance and Themes. Details of the entry are discussed in the following sections.
HKEY_LOCAL_MACHINE
Software
Microsoft
Windows
CurrentVersion
Control Panel
Extended Properties
{305CA226-D286-468e-B848-2B2E8E697B74} 2
%SystemRoot%\System32\MyCPL.cpl= [REG_DWORD] 0x00000001
The registry key {305CA226-D286-468e-B848-2B2E8E697B74} 2 is the container for all category entries. That key represents SCID_CONTROLPANELCATEGORY, and is composed of PSGUID_CONTROLPANEL and PID_CONTROLPANEL_CATEGORY, both defined in Shlguid.h.
The Name entry is the full path of your .cpl file, using environment variables if desired. The Value entry for that Name should be one of the category IDs listed in the following section, stored as a REG_DWORD.
a.. 0x00000000 : Other Control Panel Options. Any Control Panel application that does not specify a category ID is put in this category.
b.. 0x00000001 : Appearance and Themes.
c.. 0x00000002 : Printers and Other Hardware.
d.. 0x00000003 : Network and Internet Options.
e.. 0x00000004 : Sounds, Speech, and Audio Devices.
f.. 0x00000005 : Performance and Maintenance
g.. 0x00000006 : Date, Time, Language, and Regional Options.
h.. 0x00000007 : Accessibility Options.
i.. 0x00000008 : Add or Remove Programs.
j.. 0x00000009 : User Accounts.
k.. 0xFFFFFFFF : Do not add to any category.
The categories Add or Remove Programs and User Accounts work somewhat differently from other categories in Control Panel. When one or more applications are added to one of these two categories, the associated link in Control Panel opens a category page. The registered applications appear in the lower portion of the page under the heading "or Pick a Control Panel icon". When no applications are registered for one of these categories, the associated link in Control Panel directly invokes the standard Windows application for that category.
The parent key name Extended Property derives from the fact that you can access this property from script through the ExtendedProperty method on the ShellFolderItem object. The following sample Microsoft JScript® code enumerates the Control Panel items and their category identifiers (IDs).
Show Example
var strSCID = "{305CA226-D286-468e-B848-2B2E8E697B74} 2";
var shell = new ActiveXObject("Shell.Application");
var cpls = shell.Namespace(3).Items(); // 3 is the ID for Control Panel
for (i=0; i < cpls.Count; i++)
{
var fldrItem = cpls.Item(i);
Document.write("The cpl " + fldrItem.Name +
" belongs to category id " +
ldrItem.ExtendedProperty(strSCID));
}
For Control Panel applications that are implemented as Shell namespace extensions—for example, fonts or scheduled tasks—specify the category ID in the registry under the CLSID entry. For example, the registry entry for the Administrative Tools folder is as follows:
HKEY_CLASSES_ROOT
CLSID
{D20EA4E1-3957-11D2-A40B-OC5020524153}
{305CA226-D286-468e-B848-2B2E8E697B74} 2= [REG_DWORD] 0x00000005
In this case, you create a value named {305CA226-D286-468e-B848-2B2E8E697B74} 2, then store the category ID as a REG_DWORD as before.
--------------------------------------------------------------------------------
© 2003 Microsoft Corporation. All rights reserved.