Welcome to MSDN Blogs Sign in | Join | Help

Alex Yakhnin's Blog

Development and architecture for Windows Mobile devices. And a few useful tips on the way...

News

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...

Posted: Tuesday, November 11, 2008 5:28 PM by priozersk

Comments

fox23 said:

如何在程序中调用WindowsMobile系统自带的控制面板项呢?经常在论坛或者邮件组看到这样的问题,比如我们也许在自己的程序中需要添加一个

# November 14, 2008 12:43 AM
Anonymous comments are disabled
Page view tracker