Call the control panel items that come with Windows Mobile

Source: Internet
Author: User

HowProgramTo call the control panel items that come with Windows Mobile System? We often see such problems in forums or contact groups. For example, we may need to add a "Remove program" function in our programs, or set an alarm, or you need to modify other system settings. In this case, you may need to directly call the control panel that comes with the system, which is much easier than modifying the registry and designing the message storage method and designing the UI.

The following class implements this function:

 Class  Controlapplet { Public static void Showapplet ( Applettype Applet) {processstartinfo startinfo = New Processstartinfo (); startinfo. filename = @ "\ Windows \ ctlpnl.exe" ; Startinfo. Arguments = String . Format ( "Cplmain. CPL, {0 }" ,( Byte ) Applet); process. Start (startinfo );} Public static void Showapplet ( Applettype Applet, Byte Tabindex) {processstartinfo startinfo = New Processstartinfo (); startinfo. filename = @ "\ Windows \ ctlpnl.exe" ; Startinfo. Arguments = String . Format ( "Cplmain. CPL, {0}, {1 }" ,( Byte ) Applet, tabindex); process. Start (startinfo );}Public Enum  Applettype {Contrast, password, ownerinformation, power, memory, about, backlight, callback, inputmethod, callback, removeprograms, menus, buttons, todaysettings, pcconnections, modemconnections, clock, networkconnections, regionalsettings} # Region Constant Fields Public const byte Cpapplet_ownerinfo_identification = 0; Public const byte Cpapplet_ownerinfo_notes = 1; Public const byte Cpapplet_memory_main = 0;Public const byte Cpapplet_memory_runningprograms = 1; Public const byte Cpapplet_about_version = 0; Public const byte Cpapplet_about_deviceid = 1; Public const byte Cpapplet_about_copyrights = 2; Public const byte Cpapplet_backlight_battery = 0; Public const byte Cpapplet_backlight_external = 1; Public const byte Cpapplet_input_inputmehtodd = 0; Public const byte Cpapplet_input_wordcompletion = 1; Public const byte Cpapplet_input_options = 2; Public const byte Cpapplet_sndandreminders_volume = 0; Public const byte Cpapplet_sndandreminders_sounds = 1; Public const byte Cpapplet_sndandreminders_reminders = 2; Public const byte Cpapplet_menus_startmenu = 0; Public const byte Cpapplet_menus_newmenu = 1; Public const byte Cpapplet_buttons_programbuttons = 0; Public const byte Cpapplet_buttons_updowncontrol = 1; Public const byte Cpapplet_modem_connections = 0;Public const byte Cpapplet_modem_dialing = 1; Public const byte Cpapplet_clock_time = 0; Public const byte Cpapplet_clock_alarms = 1; Public const byte Cpapplet_rs_region = 0; Public const byte Cpapplet_rs_number = 1; Public const byte Cpapplet_rs_currency = 2; Public const byte Cpapplet_rs_time = 3; Public const byte Cpapplet_rs_date = 4; # Endregion }

To put it simple, just start ctlpnl.exe and input the corresponding parameters. Note that the first parameter indicates the console, and the second parameter (if any) indicates the specific tab of the console project, if it is null, it is the first tab by default. The usage is as follows:

 
Controlapplet. showapplet (controlapplet. applettype. Clock );

Effect:

Controlapplet. showapplet (controlapplet. applettype. Clock, controlapplet. cpapplet_clock_alarms );

Effect:

Download the complete example here:

Http://files.cnblogs.com/fox23/ControlPanelSample.rar

Enjoy!

Related information:

Show Control Panel programmatically

Http://www.pocketpcdn.com/articles/controlpanel.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.