Okay...
do this with regedit first and then you can look at it with registry functions
Your proggie needs to be able to accept a file name as an arg to WinMain and then open it when excecuted.
Open regedit and go to the HKEY_CLASSES_ROOT. Create a new subkey called "mywinfile". Under this create a subkey called "shell" and under this another subkey called "open". Under that put yet another key called "command". In the default entry of command, type the path of your app followed by "%1". So it will look like "C:\myprog %1".
Therefore your key will look like;
Code:
HKEY_CLASSES_ROOT
|____mywinfile
|____shell
|____open
|____command
with the default entry of "command" edited as above
Now, under HKEY_CLASSES_ROOT, create another subkey and name it with the extension you want your app to open. For instance if you want to open .mywinf, you would name the key ".mywinf". Now under the default of this key enter the name of the other subkey - "mywinfile".
now when you rightclick "somefile.mywinf" you get an open option and as long as your prog is setup, it will open