在操作系统里,我们在拷贝大文件的时候,一般会出现已个文件拷贝进度条。在DELPHI里怎么调用它呢。

解决方案 »

  1.   

    C++的例子,应该有用http://www.pcvc.net/category/content.asp?sendid=51
      

  2.   

    uses Shellapi;var
      shfos: SHFILEOPSTRUCT;
      sFrom, sTo: string;
    begin
      sFrom := 'c:\test\*.*';
      sTo := 'd:\test\';
      with shfos do begin
        shfos.Wnd := Handle;
        wFunc := FO_COPY;
        shfos.pFrom := PChar(sFrom + #0);
        shfos.pTo := PChar(sTo + #0);
        fAnyOperationsAborted := True;
        shfos.fFlags := FOF_ALLOWUNDO;
      end;
      SHFileOperation(shfos);
    end;
      

  3.   

    是操作系统里的那个进度条啊,这个在拷贝大的文件时候不好用,在VC里好像用一个文件结构实现。
    还有许多VC里的结构在DELPHI里的怎么申明和调用啊,呵呵,初用DELPHI见笑了!
      

  4.   

    加一个TAnimate,然后CommonAVI选择aviCopyFiles
      

  5.   

    用api
    uses shellapi;shfileoperation
    很好用的
      

  6.   

    var
      zz:string;
      OpStruc:TSHFileOpStruct;
      FromBuf:Array[0..128] of Char;
    begin
      zz:='d:\gd';
      FillChar(FromBuf,Sizeof(FromBuf),0);
      StrPCopy(FromBuf,Pchar(zz));
      //开始填充OpStruc记录
      with OpStruc do
      begin
        Wnd:=Handle;
        wFunc:=FO_COPY;
        pFrom:=@FromBuf;
        pTo:=nil;
        fFlags:=FOF_NOCONFIRMATION or fof_simpleprogress;
        lpszProgressTitle:='COPY';
      end;
      if SHFileOperation(OpStruc)=0 then
      //执行成功
      MessageBox(Handle,'删除完毕。','删除信息',MB_OK+MB_ICONINFORMATION);
    end;
    end.