Click here to Skip to main content
15,884,975 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
I have been dealing with an issue for the last couple days and, despite the fact that long nights of read and debug didnt help, i wasnt able to resolve for myself, so im asking for a little help on this.
Its related to icon association files, and first of all i must apologize if my english is not perfect, but i will try to be clear.

Im currently using windows 2008r2, and i believe this is something related to windows Vista/7 core, which did not happend in previous versions like XP and such, those where more simpler in doing some stuff.
I have setup a specific icon for a file, by creating the corresponding entries on the registry.

[HKEY_CLASSES_ROOT\.ssa]
@="ssaFile"
[HKEY_CLASSES_ROOT\ssaFile\DefaultIcon]
@="C:\\Windows\\Icons\\IconLib2.dll,35"


This work pretty stright, and as far as i know that is the proper way to setup an icon for a specific filetype, which, lets assume, is not associated by any program.
As i said, the file is not suposed to be associated with any problem, or at least, that is not the important factor here, but here is when the troubles begin.
Whatever i double click the file, windows ask what i want to do, as the file is not registered, which is normal, and i select, for example, to open them with notepad, or any other program, everything works fine and the file gets opened, but then the icon get changed to that specific program document icon (you know, the white page with a small icon in the middle).
I had then look again at the registry, and the keys still there and where not modified, so there is no reference to the other icon.

The guess is clear, windows is getting the file icon somewhere else, and its taking precedence over the created registry values, the problem is how to stop that.
As far as i have searched, once i select a program to open the file Windows does create some keys in here.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts

which have a reference for the opening program, but does not have any reference for the icon to display
i assume that is where windows is getting the icon from, but unfortunatly, i cannot seems to be able to delete that registry key, i got access denied (and yes, im Admin).
But besides, i assume that deleting that will just revert the situation, will givme me back my icon but will set the file to a non associated program.

So, basically, the questions is for the experts on there to know how to proper handle this situation, i need to be able to set a file icon that always takes precedence.
Anyone familiar with those issues?
Posted
Comments
Manfred Rudolf Bihy 31-Dec-10 4:41am    
That's a good question! 5+

Try this:

http://www.intowindows.com/change-file-type-icons-in-windows-7-with-types/[^]

Apparently, changing a file's icon is problematic when you try to do it through the registry on Vista/Windows 7.

 
Share this answer
 
Comments
creizlein 31-Dec-10 9:07am    
John, thanks for your reply, i wasn't actually looking for a program to change the icons since the idea is do it "by hand", but besides, i will give that program a try and see if i can monitor the registry with regmon and find out what it does modify and where store the info.

Good thing that it was wrote on .NET and is GPL.
i will share the results as soon as i got then, and this is a good point for start, Regards! ;)
I have been playing around with this Types program, and i did found some interesting results, whatever i search the mentioned SSA extension, it display a blank icon for it, aka empty, and when i go to change the icon it does change, but then, all other application that where associated to that program does change the icon as well.

Why? well, coz in fact, what Types is doing is changing the icon type of the opening application, not of this specific filetype.
it is, storing the icon change, here:
HKCR\Applications\Uedit32.exe\DefaultIcon

so, any extension that is associated with that program will get that icon, aparently, as this takes precedence over the conventional registry.

So far, for now, i still didn't found an accurate way to solve this mess, but im still researching
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900