1

I want to get the windows system icon(s) for a file type without necessarily providing an existing file path (required by SHGetFileInfo)

Is this possible, or do I have to resort to creating temporary files or reading the registry?

Brandon Cuff
  • 1,438
  • 9
  • 24

2 Answers2

3

Yes is possible using file extension as first parameter in SHGetFileInfo. You must also use SHGFI_USEFILEATTRIBUTES flags.

Xearinox
  • 3,224
  • 2
  • 24
  • 38
  • Ahh I didn't realize this was possible. To do it you have to use the SHGFI_USEFILEATTRIBUTES flag. You may want to update your answer to include this. Thanks! – Brandon Cuff Aug 30 '12 at 20:54
0

In case you were interested in an implementation I had a blog post on this in 2004 that can still be found here (about the third entry down) Old blog post

MaLio
  • 2,498
  • 16
  • 23