bianbian coding life

便便代码人生: 关注技术, 翻译文档, 偶尔动动手

[原]Delphi调用ShellAPI删除整个目录(我觉得是最快的方法)

Posted by bianbian on 2006-09-16 15:28

本文Tags: ,

  1. var
  2.   S: string;
  3.   T: TSHFileOpStruct;
  4. begin
  5.     S := '目录名';
  6.     with T do
  7.     begin
  8.       Wnd := 0;
  9.       wFunc := FO_DELETE;
  10.       pFrom := PChar(S);
  11.       pTo := nil;
  12.       fFlags := FOF_ALLOWUNDO + FOF_NOCONFIRMATION + FOF_NOERRORUI;
  13.       //标志表明允许恢复,无须确认并不显示出错信息
  14.       hNameMappings := nil;
  15.       lpszProgressTitle := '正在删除文件夹';
  16.       fAnyOperationsAborted := False;
  17.     end;
  18.     SHFileOperation(T);
  19. end;
标签: ,

遵守创作共用协议,转载请链接形式注明来自http://bianbian.org 做人要厚道

相关日志

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

(required)