You have to make the Windows Shell(Explorer) show your icon. The shell knows what icon to show for a specific file extension from the Windows registry
Now, you have to write in the registry 2 keys. For this you should use RegOpenKey/RegSetValue/RegCloseKey(there are plenty of samples in MSDN)
the keys you have to write are
HKEY_CLASSES_ROOT\.{your extension} = {name of file type}
HKEY_CLASSES_ROOT\{name of file type}\DefaultIcon = {name of your executable or icon file},{index of the icon inside executable}
Open the registry(type regedit at Windows\Run) and check the type registration for .inf file as sample
HTH,
PS: this works for sure, I have done this many times from different languages
s-)
Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
dear ionel, many thanks for your perfect description!! ok, this morning i started my comp aaaand what i saw were a lot of nice icons on my files that i was fighting for so long! but this is sth i will not be able to reproduce a second time, that's for sure!! i've only big question marks on my forehead. so, with your hint (and i love hard coded solutions) i'll not have problems in future anymore.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.