delphi 对话框初始地址InitialDir


本文整理自网络,侵删。

 我的电脑:SaveDialog1.InitialDir := '::{20D04FE0-3AEA-1069-A2D8-08002B30309D}';
// My Computer {20D04FE0-3AEA-1069-A2D8-08002B30309D}
// Network Neighborhood {208D2C60-3AEA-1069-A2D7-08002B30309D}
// Recycled {645FF040-5081-101B-9F08-00AA002F954E}

另外可使用SHGetSpecialFolder获取其它Windows虚拟文件夹,相关函数和常数定义于ShlObj。
如下面程序打开最近访问文件夹:
procedure TForm1.Button1Click(Sender: TObject);
var
PIDL: Pointer;
Path: LPSTR;
const
CSIDL_RECENT = $0008;
begin
Path := StrAlloc(MAX_PATH);
SHGetSpecialFolderLocation(Handle, CSIDL_RECENT, @PIDL);
if SHGetPathFromIDList(PIDL, Path) then // returns false if folder isn't part of file system
begin
OpenDialog1.InitialDir := Path;
OpenDialog1.Execute;
end;
StrDispose(Path);
end;

相关阅读 >>

Delphi之format函数

webbrowser部分用法

Delphi从内存流中判断图片格式

Delphi获取机器的mac地址

Delphi获取webbrowser中的元素的值

减小Delphi xe5编译出来的程序体积

Delphi 安卓添加资源图片并读取

Delphi 鼠标拖动控件自由移动位置

Delphi获取文件大小

Delphi encodeuricomponent

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...