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

> 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?

From the MSDN docs on SHGetFileInfo( ):

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

-------------
Ehsan Akhgari

List Owner: [EMAIL PROTECTED]

[ Email: [EMAIL PROTECTED]; [EMAIL PROTECTED] ]
[ WWW: http://www.beginthread.com/Ehsan ]

"Steps taken forwards, but sleepwalking back again..."
- High hopes, Pink Floyd

Reply via email to