Windows Embedded CE Shell
By default, Platform Builder provides three shells to implement the interface between the target device and the user: the command processor shell, the standard shell, and a thin client shell. Each shell supports different features to interact with the target device.
Command Processor Shell
The command processor shell provides console input and output with a limited set of commands. This shell is available for both display-enabled devices and headless devices without keyboard and display screen. For display-enabled devices, include the Console Window component (Cmd.exe) so that the command processor shell can handle input and output through a command-prompt window. Headless devices, on the other hand, typically use a serial port for input and output.
Table 3-5 lists registry settings that you must configure on the target device to use a serial port in conjunction with the command processor shell.
Table 3-5 Console registry parameters
Location | HKEY_LOCAL_MACHINE\Drivers\Console | |
---|---|---|
Registry Entry | OutputTo | COMSpeed |
Type | REG_DWORD | REG_DWORD |
Default Value | None | 19600 |
Description | Defines which serial port the command processor shell uses for input and output. | Specifies the data transfer rate of the serial port in bits per second (bps). |
■ Setting this value to -1 will redirect input and output to a debug port. | ||
■ Setting this value to zero specifies no redirection. | ||
■ Setting this value to a number greater than zero and less than 10 will redirect input and output to a serial port. |
Windows Embedded CE Standard Shell
The standard shell provides a graphical user interface (GUI) similar to the Windows XP desktop. The primary purpose of the standard shell is to start and run user applications on the target device. This shell includes a desktop with Start menu and taskbar that enables the user to switch between applications, from one window to another. The standard shell also includes a system notification area to display additional information, such as the status of network interfaces and the current system time.
Windows Embedded CE Standard Shell is a required catalog item if you select the Enterprise Terminal design template when creating an OS design project in Visual Studio by using the OS Design Wizard. If you want to clone and customize this shell, you can find the source code in the %_WINCEROOT\Public\Shell\OAK\HPC folder. Chapter 1 explains how to clone catalog items and add them to an OS design.
Thin Client Shell
The thin client shell, also called the Windows-based Terminal (WBT) shell in the product documentation, is a GUI shell for thin-client devices that do not run user applications locally. You can add Internet Explorer to a thin-client OS design, yet all other user applications must run on a Terminal server in the network. The thin client shell uses the Remote Desktop Protocol (RDP) to connect to the server and display the remote Windows desktop. By default, the thin client shell displays the remote desktop in full-screen mode.
Taskman
You can also implement your own shell by cloning and customizing the Windows Task Manager (TaskMan) shell application. The source code in the %_WINCEROOT%\Public\Wceshellfe\Oak\Taskman folder is a good starting point.
Windows Embedded CE Control Panel
The Control Panel is a special repository for central access to system and application configuration tools. The product documentation refers to these configuration tools as applets, to indicate the fact that they are embedded in the Control Panel. Each applet serves a specific and targeted purpose and does not depend on other applets. You can customize the content of the Control Panel by adding your own applets or by removing existing Control Panel applets included with Windows Embedded CE.
Control Panel Components
The Control Panel is a configuration system that relies on the following three key components:
■ Front-End (Control.exe) This application displays the user interface and facilitates starting Control Panel applets.
■ Host Application (Ctlpnl.exe) This application loads and runs the Control Panel applets.
■ Applets These are the individual configuration tools, implemented in form of .cpl files listed with icon and name in the Control Panel user interface.
For details regarding the implementation of the Windows Embedded CE Control Panel, check out the source code in the %_WINCEROOT%\Public\Wceshellfe\Oak\Ctlpnl folder. You can clone the Control Panel code and customize it to implement your own Control Panel version
Implementing Control Panel Applets
As mentioned, a Control Panel applet is a configuration tool for a system component or user application implemented in form of a .cpl file and located in the Windows folder on the target device. Essentially, a .cpl file is a DLL that implements the CPlApplet API. A single .cpl file can contain multiple Control Panel applications, yet a single applet cannot span multiple .cpl files. Because all .cpl files implement the CPlApplet API, it is a straightforward process for Control.exe to obtain detailed info about the implemented applets at startup in order to display the set of available applets in the user interface. Control.exe only needs to enumerate all .cpl files in the Windows folder and to call the CPlApplet function in each file.
According to the DLL nature and CPlApplet API requirements, .cpl files must implement the following two public entry points:
■ BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) Used to initialize the DLL. The system calls DllMain to load the DLL. The DLL returns true if initialization succeeded or false if initialization failed.
■ LONG CALLBACK CPlApplet(HWND hwndCPL, UINT message, LPARAM lParam1, LPARAM lParam2) A callback function that serves as the entry point for the Control Panel to perform actions on the applet.