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...
Comments
- Anonymous
November 13, 2008
如何在程序中调用WindowsMobile系统自带的控制面板项呢?经常在论坛或者邮件组看到这样的问题,比如我们也许在自己的程序中需要添加一个