能从一个文件的扩展名直接得到 它的默认图标吗。
该文件实际并不存在。 
具体的应用是这样的:  比如,我要在一个 CListCtrl中显示一个文件名,(此时文件在磁盘中还不存在),但是我想给这个 文件名前面加一个图标

解决方案 »

  1.   

    WINSHELLAPI DWORD WINAPI SHGetFileInfo(
        LPCTSTR pszPath,
        DWORD dwFileAttributes,
        SHFILEINFO FAR *psfi,
        UINT cbFileInfo,
        UINT uFlags
    );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.