This code illustrates how to open a control panel applet (e.g. for calibrating the touchscreen, or setting the system's date and time) using C#.
The procedure involves using the Process class to execute ctlpnl.exe \Windows\cplmain.cpl Number
where Number is an integer value corresponding the control panel applet to open. Possible values for Number are listed below:
Applet | Number |
---|---|
PC Connection | 0 |
Dialing | 1 |
Keyboard | 2 |
Password | 3 |
Owner | 4 |
Power | 5 |
System | 6 |
Display | 7 |
Mouse | 8 |
Stylus | 9 |
Volume & Sounds | 10 |
Input Panel | 11 |
Remove Programs | 12 |
Date/Time | 13 |
Certificates | 14 |
Accessibility | 15 |
void OpenApplet(int value) { using (var process = new Process()) { process.StartInfo.FileName = "ctlpnl.exe"; process.StartInfo.Arguments = @"\Windows\cplmain.cpl " + value.ToString(); process.Start(); } }