Introduction
I was working on a Shell Extension COM project which wanted the IExtractIcon
to be fed, and because it was over FTP I had a problem fetching icons to get a nice GUI. That's why I looked in CP for a solution but found none. So I developed my own approach to this task and now I think it is an interesting piece of code.
Use of the class
IconExtractor
has two important functions:
SetExtension( LCPSTR psz);//for which extension to search
GetIcon();//get the HICON for drawing
Make sure that you only create new instances if you need them.
Conclusion
The code will get you an Icon from a file extension while looking up in the Registry. Because of the need for special functions to get the icon using the extension, making an array of extensions and a doing lookup of it could/should be interesting.
I am living in germany and now living from programming for some Years. In my spare time I like sports as jogging, playing football (soccer) and basketball.
We must take care for our planet, because we and our family has no other. And everybody has to do something for it.