Index » Empathy Jukebox : Blob 86657e / symlink.pas
unit symlink;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  StdCtrls;

type
  Ttransfertype = class(TForm)
    ok: TButton;
    cancel: TButton;
    move: TRadioButton;
    copy: TRadioButton;
    symlink: TRadioButton;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  transfertype: Ttransfertype;
function transfermode(filename : string; var destination : string) : integer;

implementation
uses exploreform;

{$R *.DFM}

function transfermode(filename : string; var destination : string) : integer;
var
res : integer;
begin
result:=-1;
transfertype := ttransfertype.create(application);
try
   result:=transfertype.showmodal;
   finally
    if result=mrOk then begin

      res:=0;
      if transfertype.move.checked=true then begin
       destination:=destination+'\'+extractfilename(filename);
       res:=shellmovefile(filename,destination);

      end;

     if transfertype.copy.checked=true then begin
       destination:=destination+'\'+extractfilename(filename);
       res:=shellcopyfile(filename,destination);
      end;


      if res=0 then begin
         if (transfertype.move.checked=true) then result:=10;
         if (transfertype.symlink.checked=true) then result:=11;
         if (transfertype.symlink.checked=true) then result:=12;
      end
      else
         result:=mrCancel;
      end;
       transfertype.free;
   end;
end;



end.