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.