I don't know if you ever got this resolved but I would becurious. The reason you can't get the folder icons is becauseyou are using SHGFI_FILE_ATTRIBUTES. Take that out and use thevalue of 0 instead of 256 for the file attribute flags.
Which operating system were you developing this with? I triedmany attempts, including your example, to get a system iconusing SHGetFileInfo and writing it to the browser as"image/x-icon" just as you've shown, but it will not rendercorrectly. Am I missing something?
I really need one of two possible solutions.
1) How to properly render an icon returned by SHGetFileInfo usingthe format it in the format it provides
OR
2) How to request an icon from SHGetFileInfo that is only 256colors. I have worked with numerous other icons and they allrender to the browser properly if you use an icon directoryindex that contains only 256 colors. I could directly extractthe icon from "shell32.dll" but that would defeat the point ofusing SHGetFileInfo and would not return icons for all files. Iwould have thought that the system would load the icons andreturn you a handle to the entire icon directory, but readingthe raws bytes it is clear that the system always returns asingle icon in the directory (but if you poke into the"shell32.dll" and other places you can clearly find 3 formatsfor each size in each icon). Therefore as an alternative toreturning the 256 color format, if there is a way to get theentire icon directory for a single system icon that work aswell. I can extract desired format from there.
Any help or direction is much appreciated.
Chris
--------------------------------
From: Chris Martinez
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>jmLA0D0i6ECqEGuh9s087g==</Id>