OK this is my problem.  I am trying to associate a file extension with my program so that when every someone double clicks on a file with my created file extension it runs my program to open it. example something.mpg - if you double click on something.mpg windows media player opens it. How do i get this effect... please help
Posted on 2006-10-14 21:17:39 by ChaosVisum
I'm quite sure it's in the key

HKEY_CLASSES_ROOT\.yourfileextension

which would be

HKEY_CLASSES_ROOT\.mpg

I guess you can figure out by looking at the different examples available in your registry.
Posted on 2006-10-14 21:40:29 by roticv
Lets say you want to associate .BLA files with the program located at C:\BLAHandler.exe

In the "HKEY_CLASSES_ROOT" registry key, do the followings:

1) Create a key for ".BLA" without the quotation mark.
2) Set the (Default) value of the ".BLA" key to "BLABLA".
3) Create another key under "HKEY_CLASSES_ROOT" named "BLABLA".
4) Create these keys "Shell\Open\Command" under the key "BLABLA".
5) Put "C:\BLAHandler" in the (Default) value of the key you created at the previous step.

You can also specify the icon of your associated files. Just as roticv, you could look at other keys and get the idea.
Posted on 2006-10-14 22:55:54 by XCHG
MSDN provides details with examples on this subject...

Creating a File Association
Posted on 2006-10-14 23:53:15 by donkey
...And don't forget to call
call SHChangeNotify, SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0

after you change what you want to change.
Posted on 2006-10-15 03:13:28 by ti_mo_n
I love you guys... platonicly of coarse
Posted on 2006-10-15 22:46:06 by ChaosVisum