Shell_GetCachedImageIndexW 函数 (shlobj_core.h)

[Shell_GetCachedImageIndex 可用于“要求”部分中指定的操作系统。 它可能在后续版本中变更或不可用。 请改用 Shell_GetCachedImageIndexAShell_GetCachedImageIndexW。]

检索缓存图标的缓存索引。

语法

int Shell_GetCachedImageIndexW(
  LPCWSTR pszIconPath,
  int     iIconIndex,
  UINT    uIconFlags
);

参数

pszIconPath

TBD

iIconIndex

类型: int

在 pwszIconPath 名为 的文件中图像的索引。

uIconFlags

类型: UINT

未使用。

返回值

类型: int

返回映像的索引,失败时返回 –1。

注解

此函数 的Shell_GetCachedImageIndexAShell_GetCachedImageIndexW 版本已添加到 Windows Vista 中。 对于 Unicode 字符串,请调用 Shell_GetCachedImageIndexWShell_GetCachedImageIndex。 对于 ANSI 字符串,必须显式调用 Shell_GetCachedImageIndexA

Windows Server 2003 和 Windows XP: 仅支持 Shell_GetCachedImageIndexShell_GetCachedImageIndex 需要 Unicode 字符串。

注意

shlobj_core.h 标头将Shell_GetCachedImageIndex定义为别名,该别名根据 UNICODE 预处理器常量的定义自动选择此函数的 ANSI 或 Unicode 版本。 将非特定编码别名与非非特定编码的代码混合使用可能会导致不匹配,从而导致编译或运行时错误。 有关详细信息,请参阅 函数原型的约定

要求

   
最低受支持的客户端 Windows XP [仅限桌面应用]
最低受支持的服务器 Windows Server 2003 [仅限桌面应用]
目标平台 Windows
标头 shlobj_core.h (包括 Shlobj.h、Shlobj_core.h、Shlobj.h、Shlobj_core.h)
Library Shell32.lib
DLL Shell32.dll (5.0 或更高版本)
API 集 ext-ms-win-shell-shell32-l1-2-1 (在 Windows 10 版本 10.0.10240 中引入)

另请参阅

FileIconInit