how to launch a control panel applet in CE via C# app

  • Thread starter Thread starter BrianK
  • Start date Start date
B

BrianK

Hello all,
With a desktop OS(XP) for example this will launch a control panel
application just fine.
Process.Start("control.exe", "keyboard");
However with CE this will bring up the control panel, but will not launch
the application. What am I doing wrong?
Thanks,
Brian
 
You're assuming that "keyboard" means something. It doesn't. Control.exe
ignores its command line. What you need to do is figure out which Control
Panel applet you need and run it using a command line like this:

ctlpnl.exe <CPL file name>,<index of actual control panel applet in CPL
file>

for example, the System control panel is located in cplmain.cpl and is index
#6:

ctlpnl.exe cplmain.cpl,6

For keyboard, the index # is 2 and that applet is in cplmain.cpl:

ctlpnl.exe cplmain.cpl,2

Paul T.
 
Paul,
Thank you for your answer.
My C# example of, Process.Start("control.exe", "keyboard"); does indeed
launch the keyboard application in the XP control panel, but this was just an
example of what I need to do in a CE C# application.

How do you determine these index numbers? For example in my CE app I need
to access a control panel application called "Stylus".
Brian
 
Hi guys, how do I get the control panel actual name? I have made an application called JWMD Icon Changer for Windows Mobile 6.5

this supports changing the icons in control panels too. working pretty good.

anyway, the problem is the name when I enumerated them in Registry. What i get is just a bunch if cplmain.cpl,<#>

so the question is..
how do I get the actual name of the control panel?



Paul G. Tobey [eMVP] wrote:

Re: how to launch a control panel applet in CE via C# app
18-Sep-08

You just have to know, as far as I can tell. I have the source, since I
build devices, so I can look and see which index numbers correspond to each
applet. Here's an article that lists some (found this with a quick Google)

http://msdn.microsoft.com/en-us/library/ms838639.asp

The Stylus appears to me to be 9

Paul T


Previous Posts In This Thread:

how to launch a control panel applet in CE via C# app
Hello all
With a desktop OS(XP) for example this will launch a control panel
application just fine
Process.Start("control.exe", "keyboard")
However with CE this will bring up the control panel, but will not launch
the application. What am I doing wrong
Thanks
Brian

Re: how to launch a control panel applet in CE via C# app
You're assuming that "keyboard" means something. It doesn't. Control.exe
ignores its command line. What you need to do is figure out which Control
Panel applet you need and run it using a command line like this

ctlpnl.exe <CPL file name>,<index of actual control panel applet in CPL
file

for example, the System control panel is located in cplmain.cpl and is index

ctlpnl.exe cplmain.cpl,

For keyboard, the index # is 2 and that applet is in cplmain.cpl

ctlpnl.exe cplmain.cpl,

Paul T


Re: how to launch a control panel applet in CE via C# app
Paul
Thank you for your answer
My C# example of, Process.Start("control.exe", "keyboard"); does indeed
launch the keyboard application in the XP control panel, but this was just an
example of what I need to do in a CE C# application

How do you determine these index numbers? For example in my CE app I need
to access a control panel application called "Stylus"
Bria

:

Re: how to launch a control panel applet in CE via C# app
You just have to know, as far as I can tell. I have the source, since I
build devices, so I can look and see which index numbers correspond to each
applet. Here's an article that lists some (found this with a quick Google)

http://msdn.microsoft.com/en-us/library/ms838639.asp

The Stylus appears to me to be 9

Paul T


EggHeadCafe - Software Developer Portal of Choice
Build a C# NotifyIcon BalloonTip Scheduled Outlook Mail Checker
http://www.eggheadcafe.com/tutorial...ef-7dd29b6ae909/build-a-c-notifyicon-bal.aspx
 
Many of the control panel applets are contained in a single DLL,
cplmain.cpl. That's why you see a lot of the same name. Not all of them
are in that same DLL, but many are. If you're asking how to list the
control panel applets, I'd say, "look at the source for the control panel
application in, I think, \wince500\public\wceshellfe\oak\ctlpnl, and see
what it does".

Paul T.

Hi guys, how do I get the control panel actual name? I have made an
application called JWMD Icon Changer for Windows Mobile 6.5

this supports changing the icons in control panels too. working pretty
good.

anyway, the problem is the name when I enumerated them in Registry. What i
get is just a bunch if cplmain.cpl,<#>

so the question is..
how do I get the actual name of the control panel?



Paul G. Tobey [eMVP] wrote:

Re: how to launch a control panel applet in CE via C# app
18-Sep-08

You just have to know, as far as I can tell. I have the source, since I
build devices, so I can look and see which index numbers correspond to
each
applet. Here's an article that lists some (found this with a quick
Google):

http://msdn.microsoft.com/en-us/library/ms838639.aspx

The Stylus appears to me to be 9.

Paul T.


Previous Posts In This Thread:

how to launch a control panel applet in CE via C# app
Hello all,
With a desktop OS(XP) for example this will launch a control panel
application just fine.
Process.Start("control.exe", "keyboard");
However with CE this will bring up the control panel, but will not launch
the application. What am I doing wrong?
Thanks,
Brian

Re: how to launch a control panel applet in CE via C# app
You're assuming that "keyboard" means something. It doesn't. Control.exe
ignores its command line. What you need to do is figure out which Control
Panel applet you need and run it using a command line like this:

ctlpnl.exe <CPL file name>,<index of actual control panel applet in CPL
file>

for example, the System control panel is located in cplmain.cpl and is
index

ctlpnl.exe cplmain.cpl,6

For keyboard, the index # is 2 and that applet is in cplmain.cpl:

ctlpnl.exe cplmain.cpl,2

Paul T.


Re: how to launch a control panel applet in CE via C# app
Paul,
Thank you for your answer.
My C# example of, Process.Start("control.exe", "keyboard"); does indeed
launch the keyboard application in the XP control panel, but this was just
an
example of what I need to do in a CE C# application.

How do you determine these index numbers? For example in my CE app I need
to access a control panel application called "Stylus".
Brian

:

Re: how to launch a control panel applet in CE via C# app
You just have to know, as far as I can tell. I have the source, since I
build devices, so I can look and see which index numbers correspond to
each
applet. Here's an article that lists some (found this with a quick
Google):

http://msdn.microsoft.com/en-us/library/ms838639.aspx

The Stylus appears to me to be 9.

Paul T.


EggHeadCafe - Software Developer Portal of Choice
Build a C# NotifyIcon BalloonTip Scheduled Outlook Mail Checker
http://www.eggheadcafe.com/tutorial...ef-7dd29b6ae909/build-a-c-notifyicon-bal.aspx
 
Hi Jayson,

how do I get the control panel actual name? I have made an application
called JWMD Icon Changer for Windows Mobile 6.5
anyway, the problem is the name when I enumerated them in Registry. What i
get is just a bunch if cplmain.cpl,<#>

so the question is..
how do I get the actual name of the control panel?

You will most likely need to load the DLL (i.e. cplmain.cpl) and use the
documented control panel APIs to extract this information. It isn't stored
within the registry or filesystem, instead the DLL dynamically provides the
information when requested.

A control panel applet is simply a DLL that exports a single function called
CPlApplet (see documentation on MSDN at
http://msdn.microsoft.com/en-us/library/aa926276.aspx).

Once you load the DLL you can call the CPlApplet function, passing in a
CPL_NEWINQUIRE message (
http://msdn.microsoft.com/en-us/library/aa926872.aspx) with the number of
the applet you want details on.

On return the data structure you passed in will have a populated szName
field you should display for the specified control panel applet.

Hope this helps,
Christopher Fairbairn
 
Back
Top