Menu Overview

Send Feedback

In Windows Mobile Version 5.0, the support for soft keys that Windows Mobile-based Smartphones have enabled, is enabled as well for Windows Mobile-based Pocket PCs. The menu bar in a Windows Mobile-based Pocket PC is replaced with soft keys that access menus and define the ways in which they are displayed. The menus are rendered as soft keys for any application with one or two menus that are compiled against the Windows Mobile Version 5.0 SDK. Windows Mobile software for Pocket PCs and Smartphones supports two soft keys, SK1 and SK2. SK1 is the left soft key and is usually used for the most common action for the application. SK2 is the right soft key and is usually used to display the rest of the applications commands on a menu that is displayed when SK2 is selected.

In Windows Mobile Version 5.0, all Microsoft applications use soft keys on both Windows Mobile-based Smartphones and Pocket PCs.

Shortcut menus appear when the user taps the stylus at a point on the screen and holds it down for a short period. When the stylus is held down in a position served by a shortcut menu, animated feedback around the point of the stylus signals that a shortcut menu is going to appear. The tap-and-hold gesture for displaying shortcut menus is recognized by using the SHRecognizeGesture function in the WM_LBUTTONDOWN message handler. The shortcut menu provides commands that are useful in the context of the object under the stylus. For example, common shortcut menu commands are Cut, Copy, Paste, and Refresh. The menu can be displayed from an existing menu resource, or constructed dynamically by using the Windows Management AppendMenu function. You can also dynamically add items to an existing menu resource. Dynamically adding items to the menu is slower than using a predefined resource. but is an option if you need to create such dynamic behavior.

If you want to customize file lists with your own menu options for specific file types, you can extend shortcut menus that appear in file lists in any application, including those in Microsoft Office Mobile. For example, you can give users additional menu options when they tap and hold a .doc file in Word Mobile or in File Explorer Mobile, or when they tap and hold a .jpg file in File Explorer Mobile.

A shortcut menu extension is implemented as a COM server component. You can use an abstraction interface exposed by the application that you are adding your component to. Your component gets application-specific information through this interface. The shell sets the application's abstraction interface to be the site of your component with a call to your implementation of IObjectWithSite::SetSite. When the user opens a menu containing your extension, the shell calls your implementation of IContextMenu::QueryContextMenu to show the new commands your extension makes available. When the user selects one of the new commands, the application calls SHInvokeContextMenuCommand, which in turn calls your implementation of IContextMenu::InvokeCommand. Your component gets a reference to the application abstraction interface by calling your implementation of IObjectWithSite::GetSite.

The following tables provide information about where you can extend the softkey menu and shortcut menus in the Windows Mobile-based device user interface. They also provide details about the abstraction interface to use, which header file to include, and the registration information you'll need to register a menu extension in each UI location.

  • In the Location in User Interface column,
    • Summary screen refers to the window that shows the existing list of files created by the application.
    • Main screen refers to the editable window that provides core application functionality — for example, the blank document that appears when you tap New on the Excel Mobile summary screen.
  • You use the information contained in the Context and Class columns to register application shortcut menu extensions. For more information, see Registration Format for Application Shortcut Menu Extensions.

ActiveSync

Location in User Interface Context Class Interface Clipboard format Header file Notes
ActiveSync Tools menu ActiveSync ActiveSyncConnect None None None  

Inbox

Location in User Interface Context Class Interface Clipboard format Header file Notes
Account/Folders dialog box Inbox AccFolder_Menu IDataObject CFNAME_ITEMREFARRAY appext.h Folder currently selected in the list (ITI_FolderItemRef).
Account Setup dialog box Inbox Account_Setup IDataObject CFNAME_ITEMREFARRAY appext.h Message store currently selected in the list (ITI_StoreItemRef).
Specific compose form in Inbox Inbox Compose_%s IDataObject CFNAME_ITEMREFARRAY appext.h Replace %s with the class of the message whose menu you want to extend. For example, Compose_IPM.Note would be the Class if you wanted a menu extension that only showed up in standard IPM.Note (e-mail) compose forms.

The first entry is message (ITI_MessageItemRef). The second entry is the IMessageFormEx pointer (ITI_MessageFormExItemRef).

All compose forms in Inbox Inbox Compose_View IDataObject CFNAME_ITEMREFARRAY appext.h This class applies to all compose forms.

The first entry is message (ITI_MessageItemRef). The second entry is the IMessageFormEx pointer (ITI_MessageFormExItemRef).

Main listview in Inbox Inbox List_View IDataObject CFNAME_ITEMREFARRAY appext.h The first entry is the current folder (ITI_FolderItemRef), followed by the ENTRYIDs of selected messages (ITI_MessageItemRef).
Context menu in listview Inbox List_View_Context IDataObject CFNAME_ITEMREFARRAY appext.h The first entry is the current folder (ITI_FolderItemRef), followed by ENTRYIDs of selected messages (ITI_MessageItemRef).
Specific read form in Inbox Inbox Read_%s IDataObject CFNAME_ITEMREFARRAY appext.h Replace %s with the class of the message whose menu you want to extend. For example, Read_IPM.Schedule.Meeting.Request would be the Class if you wanted a menu extension that only showed up in meeting request read forms.

The first entry is message (ITI_MessageItemRef). The second entry is the IMessageFormEx pointer (ITI_MessageFormExItemRef).

All read forms in Inbox Inbox Read_View IDataObject CFNAME_ITEMREFARRAY appext.h This class applies to all read forms.

The first entry is the message (ITI_MessageItemRef). The second entry is the IMessageFormEx pointer (ITI_MessageFormExItemRef).

Contacts

Location in User Interface Context Class Interface Clipboard format Header file Notes
Legacy main softkey menu (tpc) AppView MSContacts IDataObject CFNAME_ITEMREFARRAY appext.h  
Summary screen menu Contacts Card_Menu IDataObject CFNAME_ITEMREFARRAY appext.h  Only supported in Windows Mobile Version 5.0 and later.
Contact Chooser softkey Contacts Chooser_Menu IDataObject CFNAME_ITEMREFARRAY appext.h  Only supported in Windows Mobile Version 5.0 and later.
Edit Card softkey Contacts Edit_Menu IDataObject CFNAME_ITEMREFARRAY appext.h  Only supported in Windows Mobile Version 5.0 and later.
Main context menu Contacts Main_ContextMenu IDataObject CFNAME_ITEMREFARRAY appext.h  
Main screen softkey Contacts Main_Menu IDataObject CFNAME_ITEMREFARRAY appext.h  Only supported in Windows Mobile Version 5.0 and later.
Legacy Tools menu Contacts Main_Tools IDataObject CFNAME_ITEMREFARRAY appext.h  
Legacy main screen View menu Contacts Main_View IDataObject CFNAME_ITEMREFARRAY appext.h  
Legacy Summary screen Tools Contacts Summary_Tools IDataObject CFNAME_ITEMREFARRAY appext.h  Only supported in Windows Mobile Version 5.0 and later.
TPC Call Log AppView MSClog IDataObject CFNAME_ITEMREFARRAY appext.h  Only supported in Windows Mobile Version 5.0 and later.
TPC Dialer AppView MSCdial IDataObject CFNAME_ITEMREFARRAY appext.h  Only supported in Windows Mobile Version 5.0 and later.
TPC Shortcuts AppView MSSCut IDataObject CFNAME_ITEMREFARRAY appext.h  Only supported in Windows Mobile Version 5.0 and later.
PPC Call Log Phone Log IDataObject CFNAME_ITEMREFARRAY appext.h  Only supported in Windows Mobile Version 5.0 and later.
PPC Speed dial Phone MSScut IDataObject CFNAME_ITEMREFARRAY appext.h  Only supported in Windows Mobile Version 5.0 and later.
PPC Phone App and TPC CProg Phone MSCProg IDataObject CFNAME_ITEMREFARRAY appext.h  Only supported in Windows Mobile Version 5.0 and later.

Calendar

Location in User Interface Context Class Interface Clipboard format Header file Notes
Summary screen softkey Calendar Card_Menu IDataObject CFNAME_ITEMREFARRAY appext.h  Only supported in Windows Mobile Version 5.0 and later.
Legacy Edit Screen Edit menu Calendar Edit_Edit IDataObject CFNAME_ITEMREFARRAY appext.h  
Main screen softkey menu Calendar Main_Menu IDataObject CFNAME_ITEMREFARRAY appext.h  Only supported in Windows Mobile Version 5.0 and later.
Legacy Main screen Tools menu Calendar Main_Tools IDataObject CFNAME_ITEMREFARRAY appext.h  
Legacy Summary screen Tools menu Calendar Summary_Tools IDataObject CFNAME_ITEMREFARRAY appext.h  

Tasks

Location in User Interface Context Class Interface Clipboard format Header file Notes
Summary screen softkey Tasks Card_Menu IDataObject CFNAME_ITEMREFARRAY appext.h  Only supported in Windows Mobile Version 5.0 and later.
Edit Card softkey Tasks Edit_Edit IDataObject CFNAME_ITEMREFARRAY appext.h  
Main screen context menu Tasks Main_ContextMenu IDataObject CFNAME_ITEMREFARRAY appext.h  
Main softkey menu in Tasks Tasks Main_Menu IDataObject CFNAME_ITEMREFARRAY appext.h  Only supported in Windows Mobile Version 5.0 and later.
Legacy main app Tools menu Tasks Main_Tools IDataObject CFNAME_ITEMREFARRAY appext.h  
Legacy Summary screen Tools menu Tasks Summary_Tools IDataObject CFNAME_ITEMREFARRAY appext.h  

Imaging

Location in User Interface Context Class Interface Clipboard format Header file Notes
Context menu in Thumbnail View Pictures imagefile IDataObject CF_HDROP appext.h  Only supported in Windows Mobile Version 5.0 and later.
Context menu in Thumbnail View PicturePicker imagefile IDataObject CFNAME_ITEMREFARRAY appext.h  Only supported in Windows Mobile Version 5.0 and later.

Remarks

The function CePimCommand has been deprecated and is no longer used for creating Outlook Mobile menu add-ins. Use the function IContextMenu instead.

IOleWindow is simply a wrapper around a window handle. IDataObject is used by your component to get data that has an associated clipboard format. For more information, see How to: Implement IDataObject.

See Also

Menus | Soft Keys (Windows Mobile) | How to: Display a Shortcut Menu from an Existing Resource | How to: Extend Shortcut Menus | How to: Implement IContextMenu and IObjectWithSite | How to: Implement IDataObject | How to: Prevent Tap-and-Hold Animation Display | How to: Register a File System Shortcut Menu | Registration Format for Application Shortcut Menu Extensions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.