delphi2007 教程

delphi2007 教程

首页 新随笔 联系 聚合 管理
  1013 Posts :: 0 Stories :: 28 Comments :: 0 Trackbacks
SHFileOperation 能不能做到当有相同文件或文件夹时,给出提示,是否覆盖? VCL组件开发及应用
http://www.delphi2007.net/DelphiVCL/html/delphi_20061223120233167.html
RT

可以的。  
   
  fFlags   :=   FOF_ALLOWUNDO;  
   
  --------------测试  
   
  procedure   TFormDemo.ButtonAPIClick(Sender:   TObject);  
  var  
      shellinfo:   TSHFileOpStructA;  
  begin  
      with   shellinfo   do  
      begin  
          wnd       :=   Application.Handle;  
          wFunc   :=   FO_COPY;  
          pFrom   :=   PChar('c:\abc.txt');  
          pTo       :=   PChar('d:\');  
          fFlags   :=   FOF_ALLOWUNDO;  
      end;  
      SHFileOperation(shellinfo);  
  end;  
   
 

谢谢,多添了一个标志.MSDN有点读不理解

Q

posted on 2008-11-18 14:29 delphi2007 阅读(358) 评论(0)  编辑 收藏 引用
只有注册用户登录后才能发表评论。