views:

78

answers:

1

I've created a Windows Mobile application that opens, edits and closes a data file format. There're a couple of features I'd like to implemenet but I'm not sure how to go about it.

  1. Create a file association so my data files have a custom icon.
  2. Process the command line (if there is one) of my application so the user can select a data file to have it open in my application.

A SO search finds this, but doesn't go into detail of what I'm looking for. I know the file associations are in the registry, but I've never touched the WinMo registry so I'm a little clueless there. I've tried Google but maybe I'm not using the right keywords because I don't find much. Any pointers in the right direction would be greatly appreciated!

+1  A: 

Take a look at HKEY_CLASSES_ROOT registry, under there are keys for file extensions, like '.txt', which the (default) value contains a name of another key (for '.txt' it is 'txtfile')

The 'txtfile' key contains keys for the default icon and the shell commands.

I suspect you can create keys and values similar to the ones that already exist for your application.

As for processing command line arguments, that should be the same as the desktop, just change your main function to have a string[] parameter and process them as necessary

[MTAThread]
static void Main(string[] args)
{
    Application.Run(new Form1());
}
Matt
Thanks. That was the point in the right direction I needed.
Michael Itzoe