简体   繁体   English

在 Delphi 中使用 ShGetFolderPath,我应该包含哪个单元?

[英]Use ShGetFolderPath in Delphi, which unit should I include?

I try to use ShGetFolderPath in Delphi XE3.我尝试在 Delphi XE3 中使用 ShGetFolderPath。 Since it is an Windows API, I search the Delphi source codes and find both Winapi.ShFolder.pas and WinApi.Shlobj.pas have its definition.由于它是Windows API,我搜索Delphi 源代码并发现Winapi.ShFolder.pas 和WinApi.Shlobj.pas 都有其定义。 I try to include ShFolder or ShlObj, both are OK.我尝试包含 ShFolder 或 ShlObj,两者都可以。 So which unit should I include for using ShGetFolderPath?那么我应该包含哪个单元来使用 ShGetFolderPath? Or can I just use any?或者我可以随便用吗?

SHGetFolderPath is deprecated and is supported only for backward compatibility. SHGetFolderPath已弃用,仅支持向后兼容。

For new system and new application you can use SHGetKnownFolderPath instead.对于新系统和新应用程序,您可以改用SHGetKnownFolderPath

About which header to include you can refer to document of that API and check the requirements part.关于包含哪个标题,您可以参考该 API 的文档并检查需求部分。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM