问题描述
用于显示选择了指定文件的资源管理器窗口的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
You need SHOpenFolderAndSelectItems. This question was early discussed here -Programmatically selecting file in explorer
Dont forget to call CoInitialize before first use of SHOpenFolderAndSelectItems
这篇关于如何显示资源管理器并选择文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!