本文整理自网络,侵删。
uses shellapi;
procedure CreateOpenDir(h : THandle; dir : string ; IsOpen : Boolean = False);var s : Cardinal;
begin if not DirectoryExists( dir ) then //判断目录是否存在 begin ForceDirectories(dir); // fileSetAttr(dir,faDirectory); // CreateDirectory(PChar( dir ), nil); end;
if IsOpen then begin ShellExecute(0,'open',nil,nil,PWideChar( dir ),SW_SHOW); end;
end;
相关阅读 >>
Delphi debug模式下可以但是release模式下报错原因之一
Delphi idhttp中设置非标准头信息和读写cookie
在一个exe文件中查找指定内容,找到则返回起始位置,否则返回0
更多相关阅读请进入《Delphi》频道 >>