Adding Custom File Types To The Win95 Registry

What each File type has, is some information in the ‘HKEY_CLASSES_ROOT’ Registry Root. This is where we will place our little file type. In this little document, we will call our file type *.hyp and the File Name will be Test_File_Hype (you can’t have spaces).

Firstly you need to make an edit in the HKEY_CLASSES_ROOT under .hyp. So:

HKEY_CLASSES_ROOT\.hyp

In the [Default] part of the Key, you will need to place “Test_File_Hype”. Then we need another edit and that is the Test_File_Hype under HKEY_CLASSES_ROOT. So:

HKEY_CLASSES_ROOT\Test_File_Hype

Under that we need another one:

HKEY_CLASSES_ROOT\Test_File_Hype\Shell

And another under that:

HKEY_CLASSES_ROOT\Test_File_Hype\Shell\Open

Under open goes Command. So:

HKEY_CLASSES_ROOT\Test_File_Hype\Shell\Open\Command

As the default value of the Command, place:

your application path.exe %1

(eg. C:\WINDOWS\HYP\HYP.EXE %1)

You must remember that you need to already expect the File to be opened that way in your application, checking the Command$() whenever your application is opened. That is important, otherwise your application will not open it.

You would probably like your file to carry your EXE’s Icon as well. This is very simply done with the following Registry edit:

HKEY_CLASSES_ROOT\Test_File_Hype\DefaultIcon

As the Default Value place:

your application path.EXE,0

Pretty cool, huh?! The last part, the zero, means that the icon is the main icon as the program. You could place other numbers if your application contains multiple icons (For example an icon just for the file.).

 

Tip Submitted By: Semin Nurkic


Discover more from dotNetTips.com

Subscribe to get the latest posts sent to your email.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.