正在阅读:实用!超强VC/MFC 常见问答收集实用!超强VC/MFC 常见问答收集

2004-07-15 10:04 出处:CSDN 作者:jiangsheng收集 责任编辑:linjixiong

  问:如何在打开一个文件夹(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.

  问:如何用代码设置环境变量? 我现正用VC开发一个项目,其中要设置几个环境变量;请问在VC中如何用代码设置环境变量?
  答:
SUMMARY
You can modify user environment variables by editing the following Registry key:

 


察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:

键盘也能翻页,试试“← →”键

关注我们

最新资讯离线随时看 聊天吐槽赢奖品