问题
I know how to change an icon for a whole file type using registry and file type association. I also know how to change an icon for a separate folder using desktop.ini file.
My questions is whether it is possible to change an icon for one specific file, let's say one.doc file?
I cannot find a way doing it, yet some upload programs seem to be able to change an icon of the currently uploaded file, while all other files of this type stay with the standard icon. How do they do it?
I can accept a solution in any language; VB, C++, C# - anything goes, though C# is preferable. Thanks
回答1:
You can use an IconHandler to allow icons to be customized on a file-by-file basis. Note that shell extensions should not be written in managed code, so C++ is the language of choice here.
Note also that it's highly unusual to be installing an icon handler for another application's file type.
来源:https://stackoverflow.com/questions/9046903/how-to-change-an-icon-for-one-single-file-of-the-specific-type