July 18th, 2012

Why don't per-item custom icons work when I open a Zip file or some other virtual folder?

A customer observed that when they opened a Zip file containing an Excel spreadsheet saved as XML, the icon for the spreadsheet in the Zip folder is just a plain XML icon rather than a fancy Excel-XML icon. “Is there any way to invoke a shell icon handler on an item inside a Zip folder?” Even if there were a way, you wouldn’t like it. Think about it: In order to determine whether the XML file should get a plain-XML icon or an Excel-XML icon, the Office icon handler needs to open the XML file and sniff around to see if has whatever it is that makes an XML file an Excel-XML file. This means that the Zip folder has to extract the file so that the icon handler can sniff it. This means that opening a Zip folder would result in decompressing every file in it just so that it can give the decompressed file to the icon handler so the icon handler can say what icon to show. You probably wouldn’t like that.

Therefore, Zip folders do not use icon handlers to obtain icons for items inside Zip files. It just uses the generic icon for the file extension.

Topics
Other

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.