如何打开资源管理器并选中一个文件?

zzan 2004-11-12 02:59:02
用ShellExecute("open",...)能在资源管理器中打开一个目录,但不知如何选中某个文件?
...全文
1642 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
蒋晟 2004-12-02
  • 打赏
  • 举报
回复

19 问:如何在打开一个文件夹(ShellExecute),同时选中某个指定的文件 ?

答:
方法1 自动化资源管理器,创建一个Explorer对象,然后用IShellBrowser和IShellView借口控制
方法2 使用Explorer.exe的/select开关
[Windows Explorer Switches]
Windows Explorer switches are useful in creating rooted folders:
Explorer [/e][,/root,<object>][[,/select],<sub object>]
/e
Use Explorer view (scope and results pane view). The default is
Open view (results in pane view only).
/root<object>
Specify the object in the "normal" name space that is
used as the root (top level) of this Explorer/Folder (i.e., local
path or UNC name). The default is the Desktop).
/Select
The parent folder opens and the specified object is selected.
<sub object> Specify the folder unless /select is used. The
default is the root.
Examples:Explorer /e, /root, \\Reports
opens an Explorer window at \\Reports.
Explorer /select, C:\Windows\Calc.exe
opens a folder at C:\Windows (or activates one that is
currently open) and selects Calc.exe.

Explorer/e,/root,\\Source\Internal\Design\Users\David\Archive
opens a folder to the Archive folder above. This is a good
way to create a dedicated, remote, documents archive
folder. A link to this folder (\\Source\Internal\Design\
Users\David\Archive) can then be placed in the SendTo folder
for quick routing of documents.
方法3 使用Windows XP提供的SHOpenFolderAndSelectItems函数
flyhigh 2004-12-02
  • 打赏
  • 举报
回复
up
zzan 2004-12-02
  • 打赏
  • 举报
回复
没有人知道吗?
老夏Max 2004-11-12
  • 打赏
  • 举报
回复
关注一下,没有做过,估计不很简单!

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧