Note: The Managed Code material is held over until next week
Topics:
This app is now available on Codeplex at https://CESerialTerm.Codeplex.com
CESerialTerm running in a vCEPC. See the captured (on desktop) output (using HVCaptureCOM) bottom right.
Windows Embedded Compact 2013 does not support the Windows 95 style Explorer Shell. It does though provide a simple shell with a dropdown menu, MinShell. This reads certain registry setting to create a list of apps that can be launched via the menu. One item is implemented, the command prompt. The Compact13MinShell Codeplex project extends the capabilities of the MinShell component from Windows Embedded Compact 2013 by adding certain runnable items to the menu. It is a selectable Catalog component that can be used instead of MinShell. WEC 2013 has also had removed a number of useful apps. Compact13Tools, also on Codeplex adds a number of useful tools and includes these in its MinShell menu. As of version 3.0 of Compact13Tools, the associated MinShell project is included and so a separate download is not required
Reliability: Compact13Tool's MinShell has also been made more reliable using an adjunct app ForeverShell which is an additional component in the Tools. This is what is actually configured to run as THE OS shell when included in the OS. It loops forever calling Compact13MinShell. That way if this MinShell exits by design or because of a an error, it is rerun.
Components: All of these components appear in the WEC 2013 Catalog under the Third Party/Embedded101 tree, if the download is unzip and copied to the 3rdParty folder under the WindowsCE Root (C:\WINCE800 typically) .. A catalog refresh is required.
Compact13Tools Components in the WEC2013 Catalog
As stated, Compact13Tools includes a number of custom apps. Whereas the Minshell and Forevershell components are native code, these have been developed as Managed Code apps. They are though included as prebuilt items in a CEComponentWiz style OS Subproject. CEComponentWiz (available on Codeplex) is affectively a Visual Studio plugin that can wrapper files into a content delivery OS subproject (rather than a project that builds a native code app or DLL).
The Compact13MinShell on its own provides the following menu items:
Comapct13Tools adds the following tools to the OS and the MinShell menu:
Compact13RegEdit
NEW: Takes directory from command line and lists all apps one or two deep in a menu for launching. Default directories are \Windows and \Temp. Replaces Compact13MyAppMenu. Also adds a Start Menu using Shortcuts (See Start Menu section below).
Background: The Compact13MinShell can also have its background image and/or color changed. You change them registry, flush the registry, then kill the shell. It then restarts(via ForeverShell) with the new settings.
Start Menu: Version 3.0 of the tools added an app, selectable from the MinShell menu that listed all apps in \Windows making it easy to run anything, especially given there is no FileExplorer to to go looking for them. (The Compact13RunApp tool can do this though.) It also had another manifestation where all apps in folders one deep in \temp can be listed for selection in a menu as well. The purpose of this is that all SDK apps under development are located in these folders. eg An SDK app called MyGame would be located as \temp\MyGame\MyGame.exe. Version 4.0 replaced this with Compact13StartMenu app which is able to list app shortcuts in a Start Menu
When MinShell starts it iterates through the registry branch HKLM\Software\Microsoft\Shell\\Minshell and generates a list of items to display in its menu. Compact13MinShell, as of V3.0 uses as diffferent branch: HKLM\Software\Compact13Tools\Shell\\Minshell A typical Compact13MinShell registry entry is:
Another example that has a command line parameters in the registry entries for the new app in V4.0, Compact13StartMenu
There are also registry entries for the desktop color and image:
As with previous versions of the OS, all app .exes are placed in \Windows but they can appear to be elsewhere in the file tree by placing shortcuts elsewhere. The Explorer Shell (no longer available for WEC from version 2013) used shortcuts for its Windows Start Menu. Shortcuts placed in \Windows\Start Menu appeared on the first level of the Start Menu. There were also special folders for things items to appear in the submenus such as Programs submenu.
This version of Compact13Tools, whilst not removing the MinShell menu, has a "Start Menu" as the first item list as *Start Menu*. Apps that have a shortcut in the folder as above appear on the floating menu and are run by a single click. Three of the Compact13Tool's subprojects have been modified so their .dat file has the required code for generation of the shortcut in that folder as above and so appear on the Start Menu are (Notepad, WebBrower, RegEditor. Other related Codeplex tools are being modified to include this shortcut generation. The new CESerialTerm already has it.
The Start Menu with some configured apps.
The required Catalog component is Compact13Start Menu, and is built as Compact13StartMenu.exe
NOTE:
Shortcuts can be used reference a file for mapping in the OS files system. They can also be used to directly run the app (if they point to an app):
Some earlier versions of CE (eg Windows Mobile) had an app for creating shortcuts insitua on the the device. Not so now. This is normally done as part of the OS development. CEComponentWiz can create them automatically for an included app.
The OS Subproject parameter DAT files create directories on the device and place files (particularly shortcuts) in them.
The format of a shortcut is NN#\Windows\TheApp.exe
The sample DAT file:
The Start Menu app, new to version 4.0 of Compact13Tools can be launched in three modes:
When launched it creates a menu at the top left of the screen, like a Start Menu, listing all items found by the folder search. It will list either .exes of shortcuts but not both. If .exes are found, no shortcuts are searched for. When run in Mode 1, the app functions as Windows Start Menu, albeit from the top rather than the bottom using shortcuts in the same manner as the Explorer Shell Start Menu. When run in Mode 2, it generates a simple listing of all apps in eth system. The final mode is useful for rerunning apps that have been downloaded to the OS under SDK app development.
To include an app in the StartMenu:
For prebuilt binaries the CEComponentWiz wizard can create a content delivery OS Subproject that package an all of its required components. It can optionally generate required shortcuts and DAT file entries. It also will optionally generate the required registry entry for it to be included in the MinShell Menu .. it does need a small upgrade (coming) so that the registry entry will be used by Compact13MinShell menu.
PLEASE TRY THESE TOOLS AND GIVE FEEDBCAK HERE OR ON CODEPLEX. THANKS
Previous:
Next:
CEComponentWiz has been updated to generate the required registry entries for Compact13Minshell for version 3.0 onwards.
Localisation More on this in a later blog but .. The path for the Start Menu Shortcuts, \Windows\Start Menu\ can be defined using a localised macro. That is macro name can be instead an the OS with substitution of a path name depending upon the localisation (language) setting. There are many of these in the file common.str: // Paths for SHGetSpecialFolderPath #define LOC_PATH_WINDOWS "\\Windows" #define LOC_PATH_DESKTOP "\\Windows\\Desktop" #define LOC_PATH_STARTUP "\\Windows\\StartUp" #define LOC_PATH_RECENT "\\My Recent Documents" #define LOC_PATH_PROGRAMS "\\Windows\\Programs" #define LOC_PATH_FAVORITES "\\Windows\\Favorites" #define LOC_PATH_FONTS "\\Windows\\Fonts" #define LOC_PATH_MYDOCUMENTS "\\My Documents" #define LOC_PATH_MYMUSIC "\\My Documents\\My Music" #define LOC_PATH_MYPICTURES "\\My Documents\\My Pictures" #define LOC_PATH_MYVIDEOS "\\My Documents\\My Videos" #define LOC_PATH_PROGRAMFILES "\\Program Files" #define LOC_PATH_APPDATA "\\Application Data" #define LOC_PATH_STARTMENU "\\Windows\\Start Menu" #define LOC_PATH_STARTMENU_PROGRAMS "\\Windows\\Start Menu\\Programs" So in the settings above, LOC_PATH_STARTMENU could have been used instead of \Windows\Start Menu.
#include "shellapi.h" //Note this is probably needed in the example above as well //Another version: BOOL SHCreateShortcutExample() { // Create a shortcut called myAppShortcut.lnk, // that links to the target file in \Windows\Program Files, named myApp.exe. // Place the shortcut in the folder \Windows. return SHCreateShortcut(TEXT("\\Windows\\myAppShortcut.lnk"), TEXT("\\Windows\\Program Files\\myApp.exe")); }
Here is some C++ code to create a shortcut programmatically. Just add it to a Console OS Subproject: BOOL SHCreateShortcutExExample() { // Create a shortcut to the file \Windows\Program Files\myApp.exe // in \Windows\myPath, with a maximum allowable shortcut name length of 64. // If successful, myAppShortcut will contain the name of the shortcut. DWORD maxLen = 64; LPTSTR myAppShortcut = new TCHAR[maxLen + 1]; return SHCreateShortcutEx(_T("\\Windows\\MyPath"), _T("\\Windows\\Program Files\\myApp.exe"), myAppShortcut, &maxLen); }