SHGetFolderPath() 32 位与 64 位 [英] SHGetFolderPath() 32 bit vs 64 bit

查看:36
本文介绍了SHGetFolderPath() 32 位与 64 位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我使用 SHGetFolderPath 在 32 位系统中使用 CSIDL_PROGRAM_FILESx86 文件夹 ID 而不是 CSIDL_PROGRAM_FILES id 调用 api?

理论上 CSIDL_PROGRAM_FILESx86 应该映射到 C:program files (x86) 在 64 位系统中,但它在 32 位系统中映射到什么路径不存在?

解决方案

MSDN 上的这篇文章.

向下滚动到备注,FOLDERID_ProgramFiles"

<块引用>

OS Application KNOWNFOLDERID 默认路径 CSIDL 等效项32 位 32 位 FOLDERID_ProgramFiles %SystemDrive%Program Files CSIDL_PROGRAM_FILES32 位 32 位 FOLDERID_ProgramFilesX86 %SystemDrive%Program Files CSIDL_PROGRAM_FILESX8632 位 32 位 FOLDERID_ProgramFilesX64(未定义) 不适用 不适用

总结:它将指向 %SystemDrive%Program Files

What happens if I use SHGetFolderPath api call in a 32 bit system with CSIDL_PROGRAM_FILESx86 folder id instead of the CSIDL_PROGRAM_FILES id?

Theoretically CSIDL_PROGRAM_FILESx86 should map to C:program files (x86) in a 64 bit system but what does it map to in a 32 bit system where this path doesn't exist?

解决方案

The different scenarios are described in this article on MSDN.

Scroll down to remarks, "FOLDERID_ProgramFiles"

OS    Application KNOWNFOLDERID            Default Path                   CSIDL Equivalent  
32 bit    32 bit  FOLDERID_ProgramFiles    %SystemDrive%Program Files    CSIDL_PROGRAM_FILES  
32 bit    32 bit  FOLDERID_ProgramFilesX86 %SystemDrive%Program Files    CSIDL_PROGRAM_FILESX86  
32 bit    32 bit  FOLDERID_ProgramFilesX64 (undefined)    Not applicable  Not applicable

Summary: It will point to %SystemDrive%Program Files

这篇关于SHGetFolderPath() 32 位与 64 位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆