Note: The Managed Code material is held over until next week

Topics:

  • Announcement:: CESerialTerm
    • A Simple Serial Terminal for Compact 2013/7
  • Updates in Compact13Tools Version 4.0
    • Includes a Windows style Start Menu
  • A Deep Dive in Compact13Tools and MinShell
  • The new Start Menu

Announcement: CESerialTerm

This app is now available on Codeplex at https://CESerialTerm.Codeplex.com

  • Project Description: A Windows Embedded Compact (2013/7) Serial Port Terminal Program
    • Is a Managed Code app as are the apps in Compact13Tools
    • Separate from the Tools at this stage though
  • Ultimately we intend publishing a variety of versions of this app that are functionally equivalent.
  • They will be different in the programming languages etc used.
  • Compact 2013 and Compact 7 versions available as OS content (CEComponentWiz style)Subprojects
    • The Compact 2013 version also contains Compact13Minshell and Compact13StartMenu entries.

CESerialTerm

CESerialTerm running in a vCEPC. See the captured (on desktop) output (using HVCaptureCOM) bottom right.


Compact 13Tools V4.0 Updates and New Features

  • Includes a new Explorer Shell style Start Menu that uses shortcuts.
  • MinShell menu is sorted
  • Corecon had the wrong registry entry in V3.0 which meant  it did not appear on the MinShell menu. It pointed to the Microsoft registry branch rather than the Compact13Tools branch. It now appears on the MinShell menu again.

MinShell and Compact13Tools Codeplex Projects

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.

Compact13Catalog

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:

  • Command prompt
  • ipconfig, with output to Debug Window
  • Target Control(shell.exe) Window on device
    • Note that this requires KITL to be enabled

Comapct13Tools adds the following tools to the OS and the MinShell menu:

Compact 2013 Tools Apps V4.0
Application Description
Compact13ForeverShell Use this as "the shell" instead. It launches 'Minshell in a loop so that if Minshell exits/crashes it is relaunched.
Compact13RunApp Can browse file system to choose app and launch it. Can navigate to shortcuts as well.
Compact13TaskManager A simple implementation of a Task Manager to switch to applications and close applications via their windows. Can also launch new tasks as per Compact13RunApp. This version PInvokes a DLL to do the Window Enums (Works in ARM).
AppWindowEnums Required by 'Taskmanager. The Native Code DLL (OS Subproject) that enumerates app windows and gets their text. Handles the Callbacks.
Compact13WebBrowser A simple Web Browser implementation in IE style using the Compact Framework WebBrowser component.
Compact13Notepad A text editor with similar UI to the Windows classic Notepad,
CoreCon3 The CoreCon modules required for debugging SDK Managed Code apps.

Compact13RegEdit

Included from http://RegEdt4CE.codeplex.com Additional functionality: Flush Registry
 Compact13StartMenu

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).

Compact13PrototypeApp Template project for creating additional tools
ConsoleAppWithWindowText Simple Native Code app that writes to its Window text. TaskManager will differentiate between such apps as it uses Window text. TaskManager cannot differentiate between apps called Console.

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

MinShell 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:

Command Prompt Menu Registry
  1. IF SYSGEN_COMPACT13MINSHELL=1
  2. IF SYSGEN_CONSOLE=1
  3. ; Menu for Command Prompt
  4. [HKEY_LOCAL_MACHINE\Software\Compact13Tools\Shell\Minshell\Command Prompt]
  5.     "App"="cmd.exe"    
  6.     "Param"=""
  7. ENDIF SYSGEN_CONSOLE
  8. ENDIF SYSYGEN_COMPACT13MINSHELL
  • The item menu text is Command Prompt
  • The app to run is cmd.exe
  • There are no command line parameters for it.
  • Note the conditionals: The registry entry will only be included in the OS registry if:
    • Compact13MinShell is included.
    • The Command Prompt is included
    • These conditionals are used throughout the Tools

Another example that has a command line parameters in the registry entries for the new app in V4.0, Compact13StartMenu

Compact13StartMenu Registry
  1. IF SYSGEN_COMPACT13MINSHELL=1
  2. IF SYSGEN_NETCF_WINFORMS=1
  3. IF SYSGEN_COMPACT13STARTMENU=1
  4. ;Use this for Managed Code Apps.
  5. [HKEY_LOCAL_MACHINE\Software\Compact13Tools\Shell\Minshell\ @StartMenu]
  6.     "App"="Compact13StartMenu.exe"
  7.     "Param"=""
  8. [HKEY_LOCAL_MACHINE\Software\Compact13Tools\Shell\Minshell\ Apps in Windows]    
  9.     "App"="Compact13StartMenu.exe"    
  10.     "Param"="Windows"
  11. [HKEY_LOCAL_MACHINE\Software\Compact13Tools\Shell\Minshell\ Apps in Temp]    
  12.     "App"="Compact13StartMenu.exe"    
  13.     "Param"="\\Temp"
  14. ;Note no leading \ in Param for the Windows entry
  15. ENDIF SYSGEN_COMPACT13STARTMENU
  16. ENDIF SYSGEN_NETCF_WINFORMS
  17. ENDIF SYSGEN_COMPACT13MINSHELL
  • There are three menu items, each with different text,
  • They all use the same app, Compact13StartMenu.exe
  • There are different command line parameters for each.
    • Each launches the app in a different manner.
    • This is discussed later in the following Start Menu section of this blog.
  • Note that for the Compact13Tools apps, the app MinShell menu registry entries are in their specific OS subproject .reg parameter file.

Other Custom Compact13MinShell Registry entries.

There are also registry entries for the desktop color and image:

Desktop Regsitry Settings
  1. IF SYSGEN_COMPACT13MINSHELL=1
  2. [HKEY_LOCAL_MACHINE\Software\Compact13Tools\Shell\Minshell]
  3.     "DesktopImage"="\\windows\\desktop.bmp"    
  4.     "Background_Color"=hex:F2,BC,0ENDIF SYSGEN_COMPACT13MINSHELL
  5. ENDIF SYSGEN_COMPACT13MINSHELL
  • Use Compact13RegEdit to modify them. It also has an ability to action the flush.
    • An image file alt.bmp is in \Windows and so can be used to test this functionality.
  • Restart Comapct13MinShell by killing it in Target Control (also on the menu)
    • Get its process number
      • gi proc
    • Kill Compact13MinShell process
      • kp <Use its process number>
        • eg kp 06
      • It will then restart with the new settings

The Start Menu

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.

startmenuv2

The Start Menu with some configured apps.

The required Catalog component is Compact13Start Menu, and is built as Compact13StartMenu.exe

NOTE:

  • This replaces Compact13MyAppMenu, that was used in the previous release to generate a a menu of runnable items under \Temp an in \Windows. Compact13StartMenu.exe using suitable command line parameters also generates these menus as the second and third MinShell menu items.
  • Compact13StartMenu project is a Managed Code Subproject of the OS and is completely built with the OS. (See my Blog on Managed Code about this .. coming later). All other Managed Code apps in the tools are prebuilt binaries.

Shortcuts and .dat filles

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):

  • They are are simple one line text file. (Can edit in Notepad)
  • Give a path to the app and an optional alternative name.
  • They have the extension .lnk
  • They can reference any kind of file, not just .exe

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.

A Sample ShortCut File
  1. 25#\Windows\CESerialTerm.exe
The format of a shortcut is NN#\Windows\TheApp.exe 
  • where NN is the number of characters in the line after #
  • The App is the name of the application
A Sample DAT File
  1. Directory("\Windows"):-Directory("Start Menu")
  2. Directory("\Windows\Start Menu"):-File("CESerialTerm.lnk","\Windows\CESerialTerm.lnk")
The sample DAT file:
  • Creates the folder \Windows\Start Menu if it doesn't exist
    • Doesn't matter if it does.
  • Places the CESerialTerm shortcut file in that folder.
  • The app can be run form that folder as if it was in that folder.

The Start Menu App

The Start Menu app, new to version 4.0 of  Compact13Tools can be launched in three modes:

Mode Number of command line parameters Leading backslash to parameter Number of folders searched What folder is search for menu items Example: Command Example: What is search for menu items
1 0   1 Start Menu shortcuts folder Compact13StartMenu \Windows\Start Menu\
2 1 No 1 The specified folder Compact13StartMenu    Windows \Windows
3 1 Yes Multiple All folders below specified folder Compact13StartMenu    \Temp \Temp\*



Note \Temp itself is not searched

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:

  • Create its LNK (shortcut) and include it as an item to be copied to the FlatRelease directory as part of the build in its postlink.bat
  • Include it in the BIB file so it gets included in the OS.
  • Edit the Subproject's DAT file to create the required folder (\Windows\Start Menu) in the OS file structure and to add the shortcut to that folder.

CEComponentWiz .. A Tool for doing this.

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: