如何显示资源管理器并选择文件? [英] How do I display Explorer with a file selected?

查看:107
本文介绍了如何显示资源管理器并选择文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用于显示选择了指定文件的资源管理器窗口的API调用是什么?正是在单击 .lnk 快捷方式的属性对话框中的查找目标...按钮时发生的情况吗?我知道可以使用该函数(或接口方法),但是我忘记了该名称,因此无法再次找到它。

What's the API call to display an Explorer window with a specified file selected? Exactly as happens when you click the "Find Target..." button in the Properties dialog of a .lnk shortcut? I know there is function (or an interface method) for that, but I forgot the name, and cannot find it again.

请注意,我知道 explorer / select,< pathname> 命令行,对使用它而不是API调用不感兴趣。

Note that I'm aware of explorer /select,<pathname> command line and not interested in using it instead of API call.

推荐答案

您需要 SHOpenFolderAndSelectItems 。此问题已在此处进行了早期讨论-
在资源管理器中以编程方式选择文件

不要忘记致电 CoInitialize 在第一次使用 SHOpenFolderAndSelectItems

You need SHOpenFolderAndSelectItems. This question was early discussed here - Programmatically selecting file in explorer
Dont forget to call CoInitialize before first use of SHOpenFolderAndSelectItems

这篇关于如何显示资源管理器并选择文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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