Inbox Menu Extensions
This code sample is named Inbox List View Menu Extensions. It demonstrates how to add new menu options to context menus in the Messaging application. It is not an application, but a DLL that is loaded by Inbox to extend its menus.
- Shell Reference
- IContextMenu interface
- IMAPIFolder interface
- IMAPIFolder::CopyMessages method
- IMAPIFolder::DeleteMessages method
- IObjectWithSite interface
- Messaging API (MAPI) API
To run the code sample
Navigate to the solution file (*.sln), and double-click it. By default, the solution files are copied to the following folders:
C:\Program Files\Windows Mobile 6 SDK\Samples\Common\CPP\Win32\InboxMenuExtensibility
Microsoft Visual Studio 2005 launches and loads the solution.
Build the solution (Ctrl+Shift+B).
Deploy the solution (F5).
After you build this code sample, you can configure Visual Studio 2005 to debug it remotely on the mobile device by following these steps.
To debug this project
In Visual Studio, right-click the InboxMenuExtensibility project in Solution Explorer, and then click Properties.
Expand Configuration Properties, and click Debugging.
In Debugger to launch:, select Smart Device Native Debugger.
In Remote Executable, type "\Windows\tmail.exe".
Click OK to save your changes.
Press F5 to begin debugging.
Using the application
- In message list view, tap & hold a message item. You will see the new menu options in the context menu that appears. These include Add Sender to Contacts, Mark All as Read, and Delete All.
InboxMenuExtensibility populates the appropriate registry settings via DllRegisterServer, which is called when the solution is deployed to a device.
The menu option Add Sender to Contacts creates a new IContact item, populates its FileAs property with the e-mail message's Display Name, and populates the Email property with the e-mail message's Email Address. If there is no Display Name, it only populates the Email property. This menu option does not parse the display name or e-mail address, and it is enabled for incoming mail folders only. It does not appear in Outbox, Sent Items, or Drafts. It appears on single message items only.
It is assumed that you have both "read" and "unread" e-mail in your Inbox.
SDK: Windows Mobile 6 Professional SDK and Windows Mobile 6 Standard SDK
Development Environment: Visual Studio 2005.
ActiveSync: Version 4.5.