executa" /> executa" /> executa"/>

Have the shell display a different icon and file type based on file format version

108 views Asked by At

I know that Windows mainly uses extensions to differentiate between files and launch programs to manipulate said files based on "extension <-> executable" associations stored in the registry. Apparently no magic numbers or exploring the file contents as in *nix systems.

Still, Visual Studio solution files display a different icon in File Explorer depending on the file format version of the solution file. How does it do that? Can it also display a different "type", for example "VS 2008 Solution" vs "VS 2022 Solution" etc, based on the same way it has File Explorer pick a different icon for these cases?

Opening is taken care by the same program, "Visual Studio Version Selector", which parses the file and opens the appropiate Visual Studio version, that's not a mystery.

What I want for my app is to use the same extension for 3 different formats I will differentiate between by doing my own parsing when the file is given to my executable as an argument by the shell. That I can do. What I do not know what to do is how to show a different icon and file type in File Explorer for each of these 3 formats. I initially thought it was not possible, but there seems to be a mechanism, judging by what Visual Studio does (and maybe even Microsoft Office, yet I don't know if I recall correctly).

0

There are 0 answers