Brandon Cuff
Brandon Cuff

Reputation: 1478

Get Shell Icon with only a file extension

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?

Upvotes: 2

Views: 1276

Answers (2)

Xearinox
Xearinox

Reputation: 3234

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

Upvotes: 4

MaLio
MaLio

Reputation: 2540

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

Upvotes: 0

Related Questions