Ashish
Ashish

Reputation: 3060

How to get a filetype icon in Windows using C/C++?

I am looking for a C/C++ code which can get icon for a given filetype (eg. .doc, .pdf) on Windows. I need to make an application which will display a list of files and I need to have the file icons corresponding to those files.

I have seen C# code for the same but I have never worked with C# and don't think that I can use the same code for my use.

Please help!

Upvotes: 2

Views: 1485

Answers (1)

tiftik
tiftik

Reputation: 988

I've found this: http://msdn.microsoft.com/en-us/magazine/cc301425.aspx

So you basically call SHGetFileInfo with SHGFI_USEFILEATTRIBUTES and any file name/path (it doesn't matter if it doesn't exist), and it writes the filetype info to a SHFILEINFO.

Upvotes: 2

Related Questions