Registering Control Panel items
Control
Panel items must be registered in order to appear in the control panel
Window. If the control panel item is implemented as part of a. EXE file
Then it is registered as a command object. Registration differs if
Item is implemented as a. dll file that exports the cplapplet function.
Specific requirements are discussed in these sections.
- Executable Control Panel item registration
- Dll Control Panel item registration
- Related Topics
Executable Control Panel item registration
For
Control Panel items implemented as. EXE files, no special exports or
Message Handling is required. Any. EXE file can be registered as
Command object to appear with an entry point in the control panel
Folder.
An example is used here to demonstrate the registration
Requirements. The example shows how to register a control panel item
CalledMy settingsAs a command object so it appears in the control panel window.My settingsWindow also appears when the commandMyApp.exe /settings
Is run.
- Generate a guid for the Control Panel item. In this example,
{0052D9FC-6764-4D29-A66F-2F3BD9E2BB40}
Is the guid of the Control Panel item. The GUID uniquely identifies the control panel item.
- Add the following information to the Registry.
- HKEY_LOCAL_MACHINE
- Software
- Microsoft
- Windows
- CurrentVersion
- Explorer
- Controlpanel
- Namespace
- {0052d9fc-6764-4d29-a66f-2f3bd9e2bb40}
(Default) = my settings
The
Data for the default entry is simply the name of the Control Panel
Item. The default entry can be a useful tag when someone is examining
The Registry, but it is optional.
- Add the following information to the Registry.
- Hkey_classes_root
- CLSID
- {0052d9fc-6764-4d29-a66f-2f3bd9e2bb40}
(Default) = [REG_SZ] My settings
Localizedstring=[Reg_expand_sz] @ % ProgramFiles %/mycorp/myapp.exe,-9
Infotip=[Reg_expand_sz] @ % ProgramFiles %/mycorp/myapp.exe,-5
System. applicationname=[REG_SZ] mycorporation. mysettings
System. controlpanel. Category=[REG_SZ] 1,8
System. Software. tasksfileurl=[REG_SZ or reg_expand_sz] % ProgramFiles %/mycorp/MyApp/mytasklinks. xml
- Default. The display name for the Control Panel item.
- Localizedstring.
Optional. The module name and string table ID of the localized name
The control panel item. The format is an at sign (@) followed by
Name of the. exe or. dll that contains the Multilingual user interface
(Mui) string table. environment variables can be used as a substitute
For a part of the path. That is followed by a comma (,) and a hyphen
(-), Followed by the ID in the string table. If the module does not
Have a string table then this value can simply be the display name
String. If you use only the display name string rather than a string
Table, the name does not adjust to the current display language.
- Infotip.
A description of the Control Panel item. This is displayed in
Infotip that is displayed when the mouse hovers over the item's icon.
The syntax is the same as that used for localizedstring, including
Option of simply providing a string rather than a string table
Reference.
- System. applicationname. The canonical name of the item. The command
control.exe /name MyCorporation.MySettings
Will open the item. See executing control panel items.
- System. controlpanel. Category.
A value that declares the categories where the item appears. Multiple
Categories are separated by commas. In this case, it specifies that
My settingsItem shoshould appear inAppearance and personalizationCategory and alsoProgramsCategory. See assigning Control Panel categories for possible values.
- System. Software. tasksfileurl. The path of the XML file that defines task links.
This can be a path as shown in the example, or an embedded Resource
Specified as a module name and resource ID such
"% ProgramFiles %/mycorp/MyApp/myapp.exe,-31 ".
- Add
Following information to the Registry to provide the path of the file
That contains the icon and the resource ID of the image within that
File.
Note
That while the syntax is otherwise similar to localizedstring and
Infotip discussed earlier, no @ character is used as a prefix.
- Add the following information to the Registry to provide the command called by the system when the user opens the control panel.
- Hkey_classes_root
- CLSID
- {0052d9fc-6764-4d29-a66f-2f3bd9e2bb40}
Dll Control Panel item registration
Control Panel items implemented in a DLL that exportsCplapplet
Function have different registration requirements than. EXE files.
Microsoft Windows 2000 and later systems, new control panel item DLLs
Shocould be installed in the associated application's folder under
Program Files Folder. items stored in the System32 directory with
. Cpl extension do not need to be registered; they are automatically
Shown in the control panel. All other control panel items usingCplappletMust be registered in one of two ways:
The following two examples registerMycplappControl Panel item. The DLL is named mycpl. CPL and is located inMycorp/MyAppApplication directory. This first example extends strates per-computer registration.
Add this information to the Registry to register the existence of the. Cpl file.
Windows Vista and later:Add this additional information to the Registry to provide a guid for the Control Panel item.
By
Generating a guid to uniquely identify the control panel item, you can
Add task links to the control panel. Without this GUID, there is no way
For the task links to be associated with the control panel item. SeeCreating searchable task links for a control panel item.
Windows Vista and later:Add the following information to the Registry to create a canonical name for the item.
By adding a canonical name, users can launch the control panel item from a command line by enteringcontrol.exe /name MyCorporation.MyCpl
.
This also makes it possible to change an implementation from a. CPL
File to A. EXE file later, without requiring calling programs to make
Any changes since they can continue opening the item through its
Canonical name. For more information on Canonical names, seeExecuting Control Panel items.
Windows Vista and later:Add the following information to the Registry to assign a control panel item to one or more categories.
Windows XP:Add the following information to the Registry to assign a control panel item to one or more categories.
This
Example assigns the item to Category 3, which is network and Internet.
To add an item to multiple categories, provide the List as a REG_SZ
Value separated by commas, such as "3, 8". values can be provided
Either decimal or hexidecimal. Note that the ability to add an item
Multiple Categories is only possible in Windows XP Service Pack 2 (SP2)
And later. SeeAssigning Control Panel categoriesFor all possible values.
Windows Vista and later:
Add the following information to the Registry to create and point to
XML file to hold task links for the item. The value must be a REG_SZ
Path as shown here or a module and resource ID (for example,
"C:/program files/mycorp/MyApp/myapp.exe,-31") if it is an embedded
Resource. The location of the XML file shocould be fully specified. it
Cannot use an environment variable such as % ProgramFiles %.
For more details on task links and how to create the XML file to hold them, seeCreating searchable task links for a control panel item.
For systems prior to Windows 2000, new control panel items must be set up in one of the following ways: