Title: RE: [MSVC] How to get icon from an extension

Check out the SHGetFileInfo function.

<MSDN>
If the uFlags parameter includes the SHGFI_USEFILEATTRIBUTES flag, this
parameter does not have to be a valid file name. The function will proceed
as if the file exists with the specified name and with the file attributes
passed in the dwFileAttributes parameter. This allows you to obtain
information about a file type by passing just the extension for pszPath and
passing FILE_ATTRIBUTE_NORMAL in dwFileAttributes.
</MSDN>

HTH.

Ciao,
Dee

-----Original Message-----
From: BeginThread.com MSVC List [mailto:[EMAIL PROTECTED]]On Behalf
Of Anders W�hlin (GIS)
Sent: Thursday, April 03, 2003 1:27 AM
To: [EMAIL PROTECTED]
Subject: [MSVC] How to get icon from an extension


Hi!

How can I get the icon for a specific extension? For example ".doc". I don't
have the file name, so I can't use SHGetFileInfo(...). I could create a
dummy file with the extension and then call SHGetFileInfo, but there has to
be another way?

Regards
/Anders

Reply via email to