Showing Control Panel applets programmatically

When developing for Windows Mobile devices, sometimes you need to show some Control panel applets from inside of your app - screen alignment or backlight settins. There are a few old online resources that describe how you can do it using native code or by creating shortcuts. Here is the managed version that will display any applet from inside of your .NET CF app:

private void ShowApplet(AppletType applet)

{

     ProcessStartInfo startInfo = new ProcessStartInfo();

     startInfo.FileName = "ctlpnl.exe";

     startInfo.Arguments = String.Format("cplmain.cpl,{0}", (int)applet);

     Process.Start(startInfo);

}

public enum AppletType

{

    Contrast,

    Password,

    OwnerInformation,

    Power,

    Memory,

    About,

    Backlight,

    AlignScreen,

    InputMethod,

    SoundsReminders,

    RemovePrograms,

    Menus,

    Buttons,

    TodaySettings,

    PCConnections,

    ModemConnections,

    Clock,

    NetworkConnections,

    RegionalSettings

 }

Enjoy...