views:

123

answers:

0

I want to use IShellItemImageFactory to retrieve the shell thumbnail of files. According to the MSDN docs, if I pass in a SIZE struct of 256x256, it should populate the HBITMAP parameter with a 256x256 bitmap, and if I use the SIIGBF_RESIZETOFIT flag, it should resize smaller thumbnails to 256x256. It doesn't. Instead, the result is a 256x256 bitmap with a small icon drawn in the middle.

Okay, maybe that's just not what SIIGBF_RESIZETOFIT is supposed to do. But then, as I understand it, I should be able to use SIIGBF_BIGGERSIZEOK and specify a tiny size (say 1x1) and it should return the actual thumbnail size instead. It doesn't. I always get whatever size I pass in.

Am I using this API incorrectly, or is it just broken? There seem to be very few examples on the web. A few discussion posts have people suggesting the API is broken. If it is indeed broken, how can I determine if a given shell item has a thumbnail? That way, I can use this method to get thumbnails and extract the icon otherwise.