File Extensions: Finding the default Icon

How it's all done

All the registry keys that we are going to use are stored under HKEY_CLASSES_ROOT. It stores them in this form:

  • Every file extension is given a key. This key will be exactly the same as the file extension including the dot (eg: HKEY_CLASSES_ROOT\.bmp).
  • This key’s "default" value refers to an application’s registry key:
  • Every application is given a key (or a group of keys if the program is associated with multiple file types). This is not necessarily the same as its “EXE name”, but in this key, among other things, there is a value that contains the location of the default file icon for this file type. For example: a “.frm” file. You should recognise this as a VB form.

This is what my registry has to say about a “.frm”:

Your registry may differ, but the format should still be the same.  The important thing to notice is how we got from “.frm” to “C:\program files\Microsoft Visual Studio\VB98\vb6.exe,1”

You might also like...

Comments

About the author

Phil Couling United Kingdom

Software developer, working in Derby, England. Currently I'm mostly developing in C++ with a combination of Borland, Visual Studio and MinGW.

Much of my work at the moment is with Databa...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but 'That's funny...'” - Isaac Asimov