rt ,怎样让直接就打开到桌面?
------解决方案--------------------
//定义结构体
global type itemidlist from structure
long cb
character abid
end type
//定义外部函数
Function long SHGetSpecialFolderLocation (long hwndOwner,long nFolder , ref ITEMIDLIST pidl ) library "shell32.dll"
Function long SHGetPathFromIDList (long pidl , ref string pszPath) library "shell32.dll" Alias for "SHGetPathFromIDListA;ansi"
//代码
string pathname
ITEMIDLIST IDL
pathname = Space(512)
SHGetSpecialFolderLocation(100,0,IDL)
SHGetPathFromIDList(IDL.cb, pathname)
messagebox('',pathname)
代码在xp+pb11.5下测试通过,如果是pb10以前版本的需要把后面一个函数声明改一下
Function long SHGetPathFromIDList (long pidl , ref string pszPath) library "shell32.dll"
调用 GetFileSaveName的时候把初始目录用获得的pathname就可以了