怎么得到文件的默认图标

hugetwo 2003-12-05 11:09:21
能从一个文件的扩展名直接得到 它的默认图标吗。
该文件实际并不存在。
具体的应用是这样的: 比如,我要在一个 CListCtrl中显示一个文件名,(此时文件在磁盘中还不存在),但是我想给这个 文件名前面加一个图标
...全文
45 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
flyhigh 2003-12-05
  • 打赏
  • 举报
回复
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.

15,978

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧