Search code examples
c#.netwindowswindows-shellshell-icons

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?


Solution

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