Context Menu Extension Handler
This code sample is named CTXMenu. It demonstrates how to implement a context menu extension handler. The application extends the File Explorer context menu that appears when you tap and hold a file.
Feature Area
Relevant APIs
- Shell and User Interface Reference
- IContextMenu interface
Usage
To run the code sample
Run "guidgen.exe" to generate a new GUID.
Copy this GUID to "guids.h", replacing the one that is already there.
Navigate to the solution file (*.sln), and double-click it. By default, the solution file is copied to the following folder:
C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Samples\CPP\Win32\CTXMenu\``ctxmenu.sln
Microsoft Visual Studio 2005 launches and loads the solution.
Build the solution (Ctrl+Shift+B).
Deploy the solution (F5). ctxmenu.dll is registered. built, and deployed to the folder
\windows
.
To use the application
- Launch File Explorer on the mobile device.
- Tap and hold on any .BMP file to bring up the context menu. You should see an additional menu item.
Remarks
The filename is retrieved from File Explorer via the IDataObject:IUnknown interface.
Context menu extensions are only loaded when a single file is selected; if multiple files are selected and the user invokes the context menu, File Explorer will not load any extension handlers.
Requirements
Pocket PC SDK: Windows Mobile 5.0 Pocket PC SDK.
Smartphone SDK: Windows Mobile 5.0 Smartphone SDK.
Development Environment: Visual Studio 2005.
ActiveSync: Version 4.0.
See Also
Code Samples | Read View Menu Extension | Medical History
Send Feedback on this topic to the authors