Partager via


Adding Custom Menus to Windows CE Explorer (Windows CE 5.0)

Send Feedback

You can add menu items to the Advanced Tools submenu of the Tools menu in the Windows CE Explorer window by modifying the registry. The method described here uses code to directly place values in the proper registry locations.

To add a custom menu, create a subkey and add the following values under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ActiveSync\ CustomMenus.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ActiveSync\CustomMenus]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WINDOWS
CE Services\CustomMenus\MySubKey]
"DisplayName"="displayName"
"Command"="myApp.exe"
"CommandArguments"="/args"
"StatusHelp"="StatusHelpText"
"Version"=version_number

All of these values, except for StatusHelp, must be present for the menu item to appear. After adding the registry values, the new menu item will appear after you disconnect any connected devices and close the ActiveSync window and then reconnect a device.

The following table describes the custom menu values.

Value Description
DisplayName String that identifies the display name of the menu item. An ampersand (&) specifies a hot key.
Command String that identifies the command that will be executed by WinExec when a user chooses the menu item.
CommandArguments String that identifies the arguments passed to the WinExec call to apply to the program specified in Command. Note that this string value can be empty, but the value itself must exist in order for the custom menu item to appear.
StatusHelp String that identifies the status and Help text that appears in the status bar when a user browses the menu item.
version_number Application version. This value should always be set to 0x00020000.

The following sample registry file adds a calculator menu item.

REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ActiveSync\CustomMenus]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WINDOWS 
CE Services\CustomMenus\MyCalculatorApp]
"DisplayName"="&My Calculator"
"Command"="calc.exe"
"CommandArguments"=""
"StatusHelp"="Brings up the calculator"
"Version"=dword:00020000

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.