调用资源管理器的问题

ibicf 2004-11-26 09:03:17
我想点击一个按钮直接打开windows的资源管理器,默认路径由我自己指定,应该怎么实现?我用delphi5,directoryListbox好像不是非常好使,请各位支招。
...全文
194 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
Kshape_zh 2005-01-23
  • 打赏
  • 举报
回复
ShellExecute(0, 'explore', 'C:\', nil, nil, SW_RESTORE);
dants 2005-01-23
  • 打赏
  • 举报
回复
用ShellExecute()
参数:
1> nil{handle to parent window}
2> 'open'{pointer to string that specifies operation to perform.包括:open, print, explore}
3> 'Explore.exe'{pointer to filename or folder name string}
4> '参数'{pointer to string that specifies executable-file parameters}
5> 'C:\WINNT'{pointer to string that specifies default directory}
6> SW_RESTORE{whether file is shown when opened}
{包括:SW_HIDE,SW_MAXIMIZE,SW_MINIMIZE,SW_RESTORE,SW_SHOW,SW_SHOWDEFAULT,SW_SHOWMAXIMIZED,SW_SHOWMINIMIZED,SW_SHOWMINNOACTIVE,SW_SHOWNA,SW_SHOWNOACTIVATE,SW_SHOWNORMAL.
注意:If 如果文件名称包括文档文件,这个参数必须是0}
ShellExecute有2种效果,一种是类似我的电脑的,另一种是类似资源管理器的。
看看Delphi带的Win32SDK帮助就知道了。
starsite 2005-01-23
  • 打赏
  • 举报
回复
ShellExecute(0, 'explore', 'C:\', nil, nil, SW_RESTORE);
ibicf 2004-11-26
  • 打赏
  • 举报
回复
up
ibicf 2004-11-26
  • 打赏
  • 举报
回复
有没有想赢得api可以打开资源管理器?
ibicf 2004-11-26
  • 打赏
  • 举报
回复
是这样,我考虑了一下,既然win+e就能打开windows资源管理器,我可以模拟快捷键,但是无法指定其默认路径。。。楼上的兄弟能不能跟我说一下怎么用directoryListbox完成上述功能呢?谢谢
helldream2002 2004-11-26
  • 打赏
  • 举报
回复
你可以选搜索到要打开的路径就可以
jinjazz 2004-11-26
  • 打赏
  • 举报
回复
ShellTreeView1.Path:='d:\'
bee2518 2004-11-26
  • 打赏
  • 举报
回复
就你那招了,没其他招
呵呵

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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