首页 > 技术文章 > Shell Extension开发IDefaultExtractIconInit::SetNormalIcon用法

suxia 2020-03-26 14:28 原文

附上官方链接:https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-idefaultextracticoninit-setnormalicon

HRESULT SetNormalIcon(
  LPCWSTR pszFile,
  int     iIcon
);

Parameters

pszFile

Type: LPCWSTR

A pointer to a buffer that contains the full icon path, including the file name and extension, as a Unicode string. This pointer can be NULL.

iIcon

Type: int

A Shell icon ID.

pszFile是图标的地址,官方就一句话,一开始误以为图标文件的地址,其实真实需要指向的是Windows存储图标的动态链接库dll:shell32.dll这个文件。

iIcon是图标的ID,可以参考以下链接进行设置:https://wenku.baidu.com/view/9a69b8394431b90d6c85c79e.html

推荐阅读