Using Control Panel

來源:互聯網
上載者:User
文章目錄
  • Contrast
  • Password
  • Owner Information. Identification
  • Owner Information. Notes
  • Power
  • Memory. Main
  • Memory. Running Programs
  • About. Version
  • About. Device ID
  • About. Copyrights
  • Backlight. Battery Power
  • Backlight. External Power
  • Input. Input Method
  • Input. Word Completion
  • Input. Options
  • Sounds & Reminders. Valume
  • Sounds & Reminders. Sounds
  • Sounds & Reminders. Reminders
  • Remove Programs
  • Menus. Start Menu
  • Menus. New Menu
  • Buttons. Program Buttons
  • Buttons. Up/Down Control
  • Today
  • Clock. Time
  • Clock. Alarms
  • Regional Settings. Region
  • Regional Settings. Number
  • Regional Settings. Currency
  • Regional Settings. Time
  • Regional Settings. Date
Using Control Panel

By Vassili Philippov, October 29, 2001.
Print version

Introduction

Sometimes we need to show a control panel applet (control panel page) from our program. That is necessary when users of your program often change some system settings and you want to provide an easy interface for that. This article shows how to open certain control panel applet from your program.

You should be careful because some Pocket PC devices don't support some control panel applets. You can find information about applets support in Creating Shortcuts to Feature Settings article by Steven Perry.

To open a Control Panel Page

You have to run ctlpnl.exe program with "cplmain.cpl,X,Y" argument where X is Id of the control panel applet and Y is an index of a tab page (most applets have several tabs). Here is a sample code that openes a control page with information about alarms.

CString strParam;<br />strParam.Format(_T("cplmain.cpl,%d,%d"), 16, 1);<br />PROCESS_INFORMATION pi;<br />if (!::CreateProcess(_T("\\Windows\\ctlpnl.exe"),<br />strParam, NULL, NULL, FALSE, 0, NULL, NULL, NULL, &amp;pi))<br />{<br />//Cannot start Control Panel process<br />}<br />

 

STControlPanel

You can also use STControlPanel library that encapsulates working with the control panel. You should create a CSTControlPanel object using control panel applet id and tab page index (the second parameter is optional).

Here is a sample code that openes a control page with information about alarms.

CSTControlPanel cp(ST_CPAPPLET_CLOCK, ST_CPAPPLET_CLOCK_ALARMS);<br />cp.Open();<br />

 

Control Panel Applets

This section enumerates only some control panel applets. Some devices contain more applets then the others, and not all enumerated applets are supported by all devices.

Contrast
Applet Id: 0
Applet Id: ST_CPAPPLET_CONTRAST
Password
Applet Id: 1
Applet Id: ST_CPAPPLET_PASSWORD
Owner Information. Identification
Applet Id: 2
Tab Index: 0
Applet Id: ST_CPAPPLET_OWNERINFO
Tab Index: ST_CPAPPLET_OWNERINFO_IDENTIFICATION
Owner Information. Notes
Applet Id: 2
Tab Index: 1
Applet Id: ST_CPAPPLET_OWNERINFO
Tab Index: ST_CPAPPLET_OWNERINFO_NOTES
Power
Applet Id: 3
Applet Id: ST_CPAPPLET_POWER
Memory. Main
Applet Id: 4
Tab Index: 0
Applet Id: ST_CPAPPLET_MEMORY
Tab Index: ST_CPAPPLET_MEMORY_MAIN
Memory. Running Programs
Applet Id: 4
Tab Index: 1
Applet Id: ST_CPAPPLET_MEMORY
Tab Index: ST_CPAPPLET_MEMORY_RUNNINGPROGRAMS
About. Version
Applet Id: 5
Tab Index: 0
Applet Id: ST_CPAPPLET_ABOUT
Tab Index: ST_CPAPPLET_ABOUT_VERSION
About. Device ID
Applet Id: 5
Tab Index: 1
Applet Id: ST_CPAPPLET_ABOUT
Tab Index: ST_CPAPPLET_ABOUT_DEVICEID
About. Copyrights
Applet Id: 5
Tab Index: 2
Applet Id: ST_CPAPPLET_ABOUT
Tab Index: ST_CPAPPLET_ABOUT_COPYRIGHTS
Backlight. Battery Power
Applet Id: 6
Tab Index: 0
Applet Id: ST_CPAPPLET_BACKLIGHT
Tab Index: ST_CPAPPLET_BACKLIGHT_BATTERY
Backlight. External Power
Applet Id: 6
Tab Index: 1
Applet Id: ST_CPAPPLET_BACKLIGHT
Tab Index: ST_CPAPPLET_BACKLIGHT_EXTERNAL
Input. Input Method
Applet Id: 8
Tab Index: 0
Applet Id: ST_CPAPPLET_INPUT
Tab Index: ST_CPAPPLET_INPUT_INPUTMEHTOD
Input. Word Completion
Applet Id: 8
Tab Index: 1
Applet Id: ST_CPAPPLET_INPUT
Tab Index: ST_CPAPPLET_INPUT_WORDCOMPLETION
Input. Options
Applet Id: 8
Tab Index: 2
Applet Id: ST_CPAPPLET_INPUT
Tab Index: ST_CPAPPLET_INPUT_OPTIONS
Sounds & Reminders. Valume
Applet Id: 9
Tab Index: 0
Applet Id: ST_CPAPPLET_SNDANDREMINDERS
Tab Index: ST_CPAPPLET_SNDANDREMINDERS_VOLUME
Sounds & Reminders. Sounds
Applet Id: 9
Tab Index: 1
Applet Id: ST_CPAPPLET_SNDANDREMINDERS
Tab Index: ST_CPAPPLET_SNDANDREMINDERS_SOUNDS
Sounds & Reminders. Reminders
Applet Id: 9
Tab Index: 2
Applet Id: ST_CPAPPLET_SNDANDREMINDERS
Tab Index: ST_CPAPPLET_SNDANDREMINDERS_REMINDERS
Remove Programs
Applet Id: 10
Applet Id: ST_CPAPPLET_REMOVEPROGS
Menus. Start Menu
Applet Id: 11
Tab Index: 0
Applet Id: ST_CPAPPLET_MENUS
Tab Index: ST_CPAPPLET_MENUS_STARTMENU
Menus. New Menu
Applet Id: 11
Tab Index: 1
Applet Id: ST_CPAPPLET_MENUS
Tab Index: ST_CPAPPLET_MENUS_NEWMENU
Buttons. Program Buttons
Applet Id: 12
Tab Index: 0
Applet Id: ST_CPAPPLET_BUTTONS
Tab Index: ST_CPAPPLET_BUTTONS_PROGRAMBUTTONS
Buttons. Up/Down Control
Applet Id: 12
Tab Index: 1
Applet Id: ST_CPAPPLET_BUTTONS
Tab Index: ST_CPAPPLET_BUTTONS_UPDOWNCONTROL
Today
Applet Id: 13
Applet Id: ST_CPAPPLET_TODAY
Clock. Time
Applet Id: 16
Tab Index: 0
Applet Id: ST_CPAPPLET_CLOCK
Tab Index: ST_CPAPPLET_CLOCK_TIME
Clock. Alarms
Applet Id: 16
Tab Index: 1
Applet Id: ST_CPAPPLET_CLOCK
Tab Index: ST_CPAPPLET_CLOCK_ALARMS
Regional Settings. Region
Applet Id: 18
Tab Index: 0
Applet Id: ST_CPAPPLET_RS
Tab Index: ST_CPAPPLET_RS_REGION
Regional Settings. Number
Applet Id: 18
Tab Index: 1
Applet Id: ST_CPAPPLET_RS
Tab Index: ST_CPAPPLET_RS_NUMBER
Regional Settings. Currency
Applet Id: 18
Tab Index: 2
Applet Id: ST_CPAPPLET_RS
Tab Index: ST_CPAPPLET_RS_CURRENCY
Regional Settings. Time
Applet Id: 18
Tab Index: 3
Applet Id: ST_CPAPPLET_RS
Tab Index: ST_CPAPPLET_RS_TIME
Regional Settings. Date
Applet Id: 18
Tab Index: 4
Applet Id: ST_CPAPPLET_RS
Tab Index: ST_CPAPPLET_RS_DATE
Related resources:
  • Section: Control Panel
  • Article: Creating Control Panel Applet
  • QA: How can I get information about Control Panel applets like dialog names, icons, etc?
  • Article: Creating Shortcuts to Feature Settings
  • Library: STControlPanel

 

DEMO:

  C#    EVC

 

轉自:

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

http://www.cnblogs.com/fox23/archive/2008/11/14/showing-Windows-mobile-control-panel-programmatically.html

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.