Einzelnen Beitrag anzeigen

Benutzerbild von Mavarik
Mavarik

Registriert seit: 9. Feb 2006
Ort: Stolberg (Rhld)
4.130 Beiträge
 
Delphi 10.3 Rio
 
#19

Re: Delphi vs. Windows, warum kopiert Windows schneller?

  Alt 4. Dez 2009, 13:20
Hi!

Warum machst Du es nicht so?

Delphi-Quellcode:
Procedure FileCopy(Source,Dest:String);
var
  OpStruc: TSHFileOpStruct;
  frombuf, tobuf: Array [0..128] of Char;
Begin
{$IFNDEF DLL}
  fillChar( OpStruc, Sizeof(OpStruc), 0 );
  FillChar( frombuf, Sizeof(frombuf), 0 );
  FillChar( tobuf, Sizeof(tobuf), 0 );
  StrPCopy( frombuf, Source );
  StrPCopy( tobuf, Dest );
  With OpStruc DO Begin
    Wnd:= Form1.Handle;
    wFunc:= FO_COPY;
    pFrom:= @frombuf;
    pTo:=@tobuf;
    fFlags:= FOF_NOCONFIRMATION or FOF_RENAMEONCOLLISION;
    fAnyOperationsAborted:= False;
    hNameMappings:= Nil;
    lpszProgressTitle:= Nil;
  end;
  ShFileOperation( OpStruc );
{$ELSE}
Messagedlg('Operation in DLL nicht mölich',mterror,[mbok],0);
{$ENDIF}
end;
Mavarik
  Mit Zitat antworten Zitat