To create a Silverlight for Windows Embedded control panel home page for your device, include the SYSGEN_CTLPNL2 catalog item in your OS design. To add standard control panel items to this Silverlight control panel home page, you can add SYSGEN variables or you can directly add registry entries and relevant source files to your OS design.

Add Standard Control Panel Items to a Control Panel Home Page

By default, your OS design includes the SYSGEN_CTLPNL2 catalog item. Registry entries are in the file %_WINCEROOT%\public\wceshellfe\oak\files\wceshellfe.reg and include the following lines to define the basic control panel home page:

;----------------------------start CONTROL PANEL 2 (Settings) ------------------------
; Main Navigation CPL
[HKEY_LOCAL_MACHINE\Software\Microsoft\Settings\{01608162-D728-4009-BDA4-3DB8585E577D}]
@="Settings main window"
"Title"="Settings main window"
"Type"=dword:2
 [HKEY_LOCAL_MACHINE\Software\Microsoft\Settings\{01608162-D728-4009-BDA4-3DB8585E577D}\SecureItems]

To add the default applications for setting time and date, display options, and audio options, you can add the SYSGEN variables for SYSGEN_DATETIMECPL, SYSGEN_DISPLAYCPL, and SYSGEN_SNDSCHEMECPL. When you build your OS design, the registry entries and relevant source files for the three control panel items are included in your run-time image. The following code is appended to the %_WINCEROOT%\public\wceshellfe\oak\files\wceshellfe.reg file:

"{9CB05CAE-D2CF-4409-8E64-352DD8F6FDE2}"=dword:10
"{129FCEAF-A3AA-4305-941C-2564A811C313}"=dword:40
"{174A20F6-2799-41f1-A3FA-E5B7AB10D1DF}"=dword:60
; Date Time XML CPL
[HKEY_LOCAL_MACHINE\Software\Microsoft\Settings\{9CB05CAE-D2CF-4409-8E64-352DD8F6FDE2}]
        @="Date and Time"
        "Title"=mui_sz:"DateTimeCpl.cpl,#400"
        "Type"=dword:0
        "XMLCPLProc"="\\windows\\DateTimeCpl.cpl"
        "Location"="\\windows\\Microsoft.DateTime.cpl.xml"
        "Icon"="\\windows\\CtlPnl2_DateTime.png"
; Display XML CPL
[HKEY_LOCAL_MACHINE\Software\Microsoft\Settings\{129FCEAF-A3AA-4305-941C-2564A811C313}]
        @="Display"
        "Title"=mui_sz:"DisplayCpl.cpl,#400"
        "Type"=dword:0
        "XMLCPLProc"="\\windows\\DisplayCpl.cpl"
        "Location"="\\windows\\Microsoft.Display.cpl.xml"
        "Icon"="\\windows\\CtlPnl2_Display.png"
; SndScheme XML CPL
[HKEY_LOCAL_MACHINE\Software\Microsoft\Settings\{174A20F6-2799-41f1-A3FA-E5B7AB10D1DF}]
        @="Sound"
        "Title"=mui_sz:"SndSchemeCpl.cpl,#400"
        "Type"=dword:0
        "XMLCPLProc"="\\windows\\SndSchemeCpl.cpl"
        "Location"="\\windows\\Microsoft.SndScheme.cpl.xml"
        "Icon"="\\windows\\CtlPnl2_Sound.png"

The first three lines in the appended code give the GUIDs of the three control panel items that are now included in the control panel home page; they are listed under the control panel home page registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Settings\{01608162-D728-4009-BDA4-3DB8585E577D}\SecureItems.

Similar to the definition of the control panel home page, the appended code further specifies registry keys for each of the three control panel item GUIDs. Each of these control panel item type is set to 0, which indicates that it is a control panel item that an XML file can provision and that Configuration Manager can display in the device UI. For more information, see Configuration Manager in Windows Embedded Compact 7 Documentation. As the preceding code example illustrates, for this type of control panel item you must specify a title (string or string resource), the location of the XML definition file (.xml), the location of the application code file (.cpl), and the location of an icon file (.png) to display in the control panel home page.

To build your OS, in Microsoft Visual Studio, on the Build menu, click Build Solution or Rebuild Solution. To download the run-time image to your device, with the device connected and selected in Visual Studio, on the Target menu, click Attach Device. To execute the basic control panel home page, on the Target menu, click Run Programs, and then select ctlpnl2.exe to run, or run the command at a command prompt. To do this in Visual Studio, on the Target menu, click Target Control, and then type s ctlpnl2. The basic control panel home page appears on your device and displays the icons for the three default control panel home pages that are defined.

See Also