How to: Extend Shortcut Menus

Send Feedback

For hands-on practice creating shortcut menu extensions, try the working WIN32 DLL example, Context Menu Extension Handler, located in the folder C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Samples\CPP\Win32\Ctxmenu\.

To extend a shortcut menu

  1. Create a shortcut menu extension COM DLL that implements IContextMenu and IObjectWithSite. For more information, see How to: Implement IContextMenu and IObjectWithSite.
  2. Register the COM component. For more information, see COM Registry Keys and CLSID Key on MSDN.
  3. Add registry entries to your Windows Mobile–based device, that specify where you want the shortcut menu extension to appear and how you want it to behave. You can register your shortcut menu extension generically, for handling shortcut menu extensions for the file system; or you can register it for a specific application. For more information, see Registration Format for File System Shortcut Menu Extensions or Registration Format for Application Shortcut Menu Extensions.
  4. Copy your compiled component DLL (for example, cmycomp.dll) to the \Windows folder on your Windows Mobile–based device.

You can now invoke the shortcut menu extension with a tap-and-hold gesture.

See Also

Menus | How to: Display a Shortcut Menu from an Existing Resource | How to: Register a File System Shortcut Menu | Registration Format for Application Shortcut Menu Extensions | Registration Format for File System Shortcut Menu Extensions | Shortcut Menu Overview

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.