Click to See Complete Forum and Search --> : Registering File Types


Sean Newell
February 19th, 2000, 04:16 AM
Hi, my program creates a number of files that I would like to register as a known file type with the windows OS. Rather than manually doing this (ie via the explorer window) I would like to be able to do this in software, say when the user first runs the program. These files have the suffix ".ntm"

Then, once registered, when the user double clicks one of the ".ntm" files my application opens and I display the contents of that file somewhere on one of the forms.

There are 2 issues here and help with either (or both preferably!) will be gratefully received,

Can anyone help?

Thanks in advance

Sean Newell

Crazy D
February 19th, 2000, 05:00 AM
Not a ready-to-go answer, but I'm sure you can work it out... :-)
Check out the registry, HKEY_CLASSES_ROOT, and take a file that is registered as example. bmp is easy (I used .frm when I needed it). See what the values say, first you find the .extension key, if you open it, you see a description... A little lower there's a key with that description, and see what the values are, and check in your windooz explorer what it says with the selected filetype... it's harder to explain then to see it for yourself... it's really so easy.
To modify it, go to the main codeguru/vb section, and I think in ActiveX you can download a regstry class for easy registry access....
Once you fixed it all, you need to read out Command$ in your program, which contains the commandline (the file), open that and do with it what you want....
hth

Crazy D :-)
"One ring rules them all"

czimmerman
February 28th, 2000, 12:55 PM
See http://www.freevbcode.com/ShowCode.Asp?ID=322