In Windows Vista, we have expanded the way that we implement Control Panel applets. In the past, you would package these as *.cpl files (and you still can). With Windows Vista, you can also create a control panel applet as an executable file (or by invoking your main executable with command line arguments), and then register that applet.

This can come in handy, as there are well published guidelines for specifying elevation level for an executable file with a manifest, but no such guidance for .cpl files. This makes sense, because .cpl files are really just .dll files that have been renamed. Since you don't elevate in process, this becomes more of a challenge. It's easier to just point to a manifested .exe, and this is what we recommend for developers targeting Windows Vista.

We provide guidelines on registering control panel applets here: http://msdn2.microsoft.com/en-us/library/aa969284.aspx.

I was playing around with this for the purpose of some demos, and rather than setting these registry entries manually, I opted to just create an installer that would set the appropriate registry entries. I figured I would take the .wxs file I created for WIX, trim out the bits from the rest of my installer, and share this. Developing as an .exe and then just registering it should simplify the development process, because now your control panel application behaves the same way as the rest of your desktop applications.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">
  <Product Id="{guid#1}" Name="CplApp" Language="1033" Version="1.0.0.0" Manufacturer="Your Company">
    <Package Id="{guid#2}" Description="CplApp" Manufacturer="Your Company" InstallerVersion="200" Compressed="yes" />
    <Media Id='1' Cabinet='CplApp.cab' EmbedCab='yes' VolumeLabel='CplApp'/>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLLOCATION" Name="CplApp" >
          <Component Id="CplApp" Guid="{guid#3}">
            <File Id="CplAppExe" Assembly="no" Name="CplApp.exe" Source="path\CplApp.exe" DiskId="1" />
            <File Id="CplAppIco" Assembly="no" Name="CplApp.ico" Source="path\CplApp.ico" DiskId="1" />
            <Registry Id="CplNamespaceKey" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\Namespace\{guid#4}" Action="createKeyAndRemoveKeyOnUninstall" >
              <Registry Id="CplNamespaceValue" Value="CplApp" Type="string" Action="write" />
            </Registry>
            <Registry Id="CplClassIdKey" Root="HKCR" Key="CLSID\{guid#4}" Action="createKeyAndRemoveKeyOnUninstall" >
              <Registry Id="CplClassIdValue" Value="CplApp" Action="write" Type="string" />
              <Registry Id="CplAppNameValue" Name="System.ApplicationName" Value="YourCompany.CplApp" Action="write" Type="string" />
              <Registry Id="CplAppCategoryValue" Name="System.ControlPanel.Category" Value="1,8" Type="string" Action="write" />
              <Registry Id="CplLocalizedStringValue" Name="LocalizedString" Value="CplApp" Type="expandable" Action="write" />
              <Registry Id="CplInfoTipValue" Name="InfoTip" Value="Runs Your Control Panel Applet" Type="expandable" Action="write" />
              <Registry Id="CplDefaultIconKey" Key="DefaultIcon" Action="createKeyAndRemoveKeyOnUninstall" >
                <Registry Id="CplDefaultIconValue" Value="%ProgramFiles%\CplApp\CplApp.ico" Type="expandable" Action="write" />
              </Registry>
              <Registry Id="CplShellKey" Key="Shell\Open\Command" Action="createKeyAndRemoveKeyOnUninstall" >
                <Registry Id="CplShellValue" Value="%ProgramFiles%\CplApp\CplApp.exe" Type="expandable" Action="write" />
              </Registry>
            </Registry>
          </Component>
        </Directory>
      </Directory>
    </Directory>
    <Feature Id="ControlPanelAll" Title="All Control Panel Application Files" Level="1">
      <ComponentRef Id="CplApp" />
    </Feature>
  </Product>
</Wix>