Wednesday, August 12, 2009

Default Windows Mobile Applications

How do you start the default Windows Mobile applications like Calendar, Contacts or Messaging from your application? I recently came across this question in the Visual Studio Smart Device Development - Native C++ Project (quite a long name, huh?) MSDN forum. The answer is quite simple and relies on a registry entry that has been around at least since Windows Mobile 2003:

HKEY_LOCAL_MACHINE\Software\Microsoft\Shell\Rai

Here you find a list of varying size containing all the default applications in your machine (both a human-readable name and the required command line). For instance, on my HTC Touch Pro the calendar is stored in the following entry:

HKEY_LOCAL_MACHINE\Software\Microsoft\Shell\Rai\:MSCALENDAR

The application's human-readable name is stored in the "0" (zero) key while the command line is stored in the "1" key. If you look up this in your device's registry you will probably find something like:

:MSPOUTLOOK calendar

Note that this requires further expansion by looking up the following entry:

HKEY_LOCAL_MACHINE\Software\Microsoft\Shell\Rai\:MSPOUTLOOK

The value of the "1" key contains "poutlook.exe" so the final command line to start the Calendar application must be "poutlook.exe calendar". Easy huh?

3 comments:

Unknown said...

that was a gr8 post .
which of this is the registry entry for the default dialer app.
i could not find nay for the dialer app.

João Paulo Figueira said...

Look for the :MSCPROG entry.

Eric said...

Thanks for the very useful info! I couldn't find this anywhere else on the net.

This does allow you to change a number of defaults, unfortunately, it doesn't seem to be able to change the default media player (or I just don't know how). There are keys for :HTCAudio and :WMPLAYER. I'm doubtful that I should change references to WMP to HTC Audio Manager, but when I try this, it seems to have no effect (reboots included) on my HTC Touch HD.

I know it's a long shot telling you this, but my gripe is really just that my bluetooth headphones only work with WMP and not with HTC's great music app!

Anyway, thanks again for sharing this hidden gem of incredibly useful keys!