Einzelnen Beitrag anzeigen

maximi

Registriert seit: 9. Jun 2003
217 Beiträge
 
Delphi 7 Personal
 
#7

Re: Kann man auch Ordner kopieren???

  Alt 9. Sep 2003, 15:42
So ich hab jetzt mal ein Code erstellt, aber mit dem kopieren klappts immer noch nicht!!

Code:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,ShellApi;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);

  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}





procedure TForm1.Button1Click(Sender: TObject);
 var
  FromPath, ToPath: WideString;
  SHFileOpStruct: TSHFileOpStruct;
  aOperation: FILEOP_FLAGS; aFrom, aTo: AnsiString;
    Flags: FILEOP_FLAGS;
begin
  FromPath := 'c:\asd.jpg'#0#0;
  ToPath := 'e:\asd.jpg'#0#0;
  with SHFileOpStruct do
  begin
    Wnd := 0;
    wFunc := aOperation;
    pFrom := PAnsiChar(FromPath);
    if ToPath <> '' then
    begin
      pTo := PAnsiChar(ToPath)
    end else begin // target available
      pTo := nil;
    end; // target not available
    fFlags := Flags;
  end; // structure


end;

end.

Max
  Mit Zitat antworten Zitat