您好,欢迎来到[编程问答]网站首页   源码下载   电子书籍   软件下载   专题
当前位置:首页 >> 编程问答 >> VC/MFC >> 如何打开资源管理器并选中一个文件?

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

来源:网络整理     时间:2016/7/15 21:16:20     关键词:

关于网友提出的“ 如何打开资源管理器并选中一个文件?”问题疑问,本网通过在网上对“ 如何打开资源管理器并选中一个文件?”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题: 如何打开资源管理器并选中一个文件?
描述:

用ShellExecute("open",...)能在资源管理器中打开一个目录,但不知如何选中某个文件?


解决方案1:


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,][[,/select],]
/e
   Use Explorer view (scope and results pane view). The default is
   Open view (results in pane view only).
/root
   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.
      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函数


以上介绍了“ 如何打开资源管理器并选中一个文件?”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/2685944.html

相关图片

相关文章