获取快捷方式文件路径时出现问题!

发布于 2024-09-01 18:46:55 字数 234 浏览 6 评论 0原文

在我的应用程序中,我可以选择将文件添加到列表中。它可以让用户同时选择多个文件吗?我使用 CFileDialog 来执行此操作,并且我启用了 OFN_MULTISELECT (用于多选)...问题我面临的是,当我尝试添加快捷方式文件时..它没有采用实际的快捷方式路径,而是引用实际路径。实际上我想避免快捷方式文件被添加到我的列表中,但是正在添加的每个快捷方式文件没有扩展名“.lnk”(我不知道原因)。 那么,有什么办法可以让我们忽略添加的快捷方式文件呢?

In my application,I have an option of adding files to a list..were it will let the user to select multiple files at the same..am using CFileDialog to do tis and I enabled OFN_MULTISELECT (for multiselect)...The problem am facing is,When I try to add a shortcut file..its not taking the actual shortcut path,its reffering to the actual path.Actually I wanted to avoid shortcut file being added to my list,but every shortcut file that is being added does not have the extension ".lnk"(i dont know the reason).
So,is there any way that we can neglect the shortcut file being added.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

行雁书 2024-09-08 18:46:55

您需要旗帜:

OFN_NODEREFERENCELINKS = 0x100000;

问候
哎呀
PS:它不会忽略添加链接,但它确保链接保持原样。您将获得带有 *.lnk 扩展名的链接文件。之后您可以在代码中过滤掉它们。

You need the flag:

OFN_NODEREFERENCELINKS = 0x100000;

regards
Oops
PS: it does not neglect links from being added, but it ensures to let the link as it is. You will get files with *.lnk extensions for links. afterwards you can filter them out in you code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文