Using IContextMenu to extend Windows apps

I read a couple of weeks ago about Google acknowledging that they’d released too many products, and deciding to focus on developing features for existing products where possible in future. screenshotWith this in mind, this evening’s idea for Windows Mobile development is an extension to one of the core applications rather than a new application.

‘Email Triage’ is my extension to Pocket Outlook. Pocket Outlook comes with Tasks, Calendar and Messaging (for emails, SMS, and MMS). Despite the way the ‘Pocket Outlook’ sounds, these are more or less separate applications, which don’t interact other than sharing a common database to store information. As a user, the common name feels like mainly a branding thing. So I thought I’d try bringing them a bit closer together.

The idea of “Email Triage” is to help me get through my Inbox as efficiently as possible. Every email I get is either telling me about a meeting or event (in which case the information gets copied to my Calendar), asking me to do something (in which case I copy the information to my Task list), or contains some useful information that I need to keep (in which case I copy it for reference in my personal wiki). The 43Folders series on ‘Inbox Zero‘ explains this better, but basically I try and keep my inbox empty – it’s a place where stuff waits temporarily to get processed.

Doing this is much more long-winded when working on my PDA, so the idea of “Email Triage” is to let me zip through my Inbox very quickly, with just a couple of taps on the each message to choose how to file it – moving it to my Task list, using it to create an entry in Calendar, or filing it’s contents as a new page in my personal Wiki.

This is more how I want to work on a PDA. It’s not a tool for getting into detailed work, but it should be great for making sure that I’m on top of any new work that has come in by email.

Extending existing apps is a little more tricky than the drag-and-drop throw-code-together approach I got away with for my new programs. For starters, the interface to extend menus and context menus appears to have only been exposed to native code apps.

The idea is to implement the IContextMenu interface – whether you are extending a soft-key menu, context menu, or both. You then compile your code into a DLL, which needs to be registered on the PDA, so whichever app’s extension point you are adding menu items to knows to call on your code when the menu is created.

QueryContextMenu is called when the menu is created, so menu items can be created here. In GetCommandString you return the string that should be displayed in the menu item. And in InvokeCommand you put the code to run if the menu item is clicked on.

5 Responses to “Using IContextMenu to extend Windows apps”

  1. […] I mentioned ages ago about a little extension I wrote for my phone that lets me dump the contents of an email that I receive into any other bit of Pocket Outlook – turning an email about an event into a Calendar item, or an email asking me to do something into a Task item – with a single click. […]

  2. […] I’d create a tool that treats them as tasks that need processing. I’ve found this approach quite useful on my phone so thought it might be […]

  3. […] got a nice email last week from someone asking why I never made the “triage” Outlook plugin I mentioned last year available as I have with other bits of code. The short answer was obviously […]

  4. KoolPla says:


    Where can I download this extension? Will it work with windows mobile 6.1?

    Please share this amazing extension.