当前位置: 代码迷 >> PB >> 在PB中定位到一个文件夹,不适用explorer解决方法
  详细解决方案

在PB中定位到一个文件夹,不适用explorer解决方法

热度:55   发布时间:2016-04-29 05:44:26.0
在PB中定位到一个文件夹,不适用explorer
如题!
就像是从我的电脑,进入F盘,再双击打开Downloads文件夹那样,直接定位到Downloads

------解决方案--------------------
FUNCTION Long ShellExecute(Long hwnd, String lpOperation, String lpFile, String lpParameters, String lpDirectory, Long nShowCmd) LIBRARY "shell32.dll" ALIAS FOR "ShellExecuteA" 

Constant Long SW_SHOWNORMAL = 1

//资源管理器 - 根目录, 指定驱动器树形浏览视图
ls_Topic = "Open"
ls_File = "explorer.exe"
ls_Params = "F:\download"
SetNull(ls_Directory)

ShellExecute(0, ls_Topic, ls_File, ls_Params, ls_Directory, SW_SHOWNORMAL)
------解决方案--------------------
引用:
FUNCTION Long ShellExecute(Long hwnd, String lpOperation, String lpFile, String lpParameters, String lpDirectory, Long nShowCmd) LIBRARY "shell32.dll" ALIAS FOR "ShellExecuteA" 

Constant Long SW_SH……


直接
string str_null
setnull(str_null)
string ls_path = "F:\download"
ShellExecute(0, str_null, ls_path, str_null, str_null, 1)

即可
  相关解决方案