Template Information

Trang

WinCE Shortcut to Control Panel Applet

Thứ Năm, 8 tháng 9, 2011 / 10:39

A recently invoked query on the MSDN news group for Windows CE has induced me to script this post. Most of our WinCE guys might be aware of creating a shortcut for a file. Now a simple question – Is it possible to create a short-cut to each and every individual control panel application? The answer is YES, it’s possible and quite enthusiastic too.
Shortcut syntax
A shortcut file has the extension of .lnk, containing the following entry as a command line parameter.
nn# command [optional parameters]
Where “nn” denotes the number of characters followed by the # symbol. The “command” denotes the actual command and the “[optional parameters]” represent the optional arguments for the command. For example, 27#\Windows\iexplore.exe –home – is a command to open an internet explorer with home page. This entry should also be saved in the iexplore.lnk file.
Control Panel Applets
Control panel applets are individual configuration tools, implemented in the form of .cpl files listed with icon and name in the Control Panel user interface. A .cpl file is a DLL that implements the CPlApplet API. Ctlpnl.exe loads and runs the control panel applets.  A single .cpl file can contain single as well as multiple Control Panel applications.
Shortcut to Control Panel Applets
Normally we can create a shortcut for a single file or a .cpl file containing single control panel application in a straight forward approach. An example for it is as follows:
33#”ctlpnl.exe” \Windows\intlp.cpl
Where Intlp.cpl is a control panel applet for regional language settings that contains a single control panel application.
Another example for a control panel applet containing multiple control panel application is cplmain.cpl.
Let us see the list of shortcut entries for each control panel application that resides in the Cplmain.cpl.
  1. PC Connection -  35#”ctlpnl.exe” \Windows\cplmain.cpl,0
  2. Dialing -  35#”ctlpnl.exe” \Windows\cplmain.cpl,1
  3. Keyboard -  35#”ctlpnl.exe” \Windows\cplmain.cpl,2
  4. Password -  35#”ctlpnl.exe” \Windows\cplmain.cpl,3
  5. Owner -  35#”ctlpnl.exe” \Windows\cplmain.cpl,4
  6. Power  -  35#”ctlpnl.exe” \Windows\cplmain.cpl,5
  7. System -  35#”ctlpnl.exe” \Windows\cplmain.cpl,6
  8. Display -  35#”ctlpnl.exe” \Windows\cplmain.cpl,7
  9. Mouse -  35#”ctlpnl.exe” \Windows\cplmain.cpl,8
  10. Stylus -  35#”ctlpnl.exe” \Windows\cplmain.cpl,9
  11. Volume & sounds -  35#”ctlpnl.exe” \Windows\cplmain.cpl,10
  12. Input Panel -  35#”ctlpnl.exe” \Windows\cplmain.cpl,11
  13. Remove Programs -  35#”ctlpnl.exe” \Windows\cplmain.cpl,12
  14. Date/Time -  35#”ctlpnl.exe” \Windows\cplmain.cpl,13
  15. Certificates -  35#”ctlpnl.exe” \Windows\cplmain.cpl,14
  16. Accessibility -  35#”ctlpnl.exe” \Windows\cplmain.cpl,15
Ctlpnl.exe invokes the cplmain.cpl with its parameters 0 to 15 to execute the corresponding control panel applications. The parameter to the cplmain.cpl is given from 0 to 15 based on the array index value of CPLAPPLETINFO rgApplets[] = { …….}. This control panel applet table presents in the \PUBLIC\ WCESHELLFE\OAK\CTLPNL\CPLMAIN\cpltable.cpp file.
Exposing Shortcut on Desktop
WinCE Shortcut
WinCE Shortcut
Following steps are involved to integrate the shortcut file with the OS image:
  • To create the required shortcut, copy the shortcut command line parameter entry in notepad application and save it as a .lnk file. For example, a shortcut file for Date-Time.lnk is containing the following entry.
35#”ctlpnl.exe” \Windows\cplmain.cpl,13
  • Copy this file to your \WINCE600\PLATFORM\<your BSP>\Files folder. This will be automatically copied to your release folder during build process.
  • Open a \WINCE600\PLATFORM\<your BSP>\Files\platform.bib and add the following entry in the FILES section to make this shortcut file as a part of the nk.bin.
Date-Time.lnk               $(_FLATRELEASEDIR)\ Date-Time.lnk            NK
This Date-Time.lnk will be resided in \windows folder of your device.
  • Open the \WINCE600\PLATFORM\<your BSP>\Files\platform.dat and add the following entry to show the shortcut on desktop.
Directory(“\Windows\LOC_DESKTOP_DIR”):-File(“Date-Time.lnk”,”\Windows\Date-Time.lnk”)
  • The following figure shows the shortcut for Date-Time control panel application on the device desktop and also it has been indicated by a red elliptical mark.

0 nhận xét:

Đăng nhận xét