All pastes #82303 Raw Edit

AAL

public text v1 · immutable
·published 2006-07-08 07:50 UTC
rendered paste body
....

function DoFileWork(aOperation: FILEOP_FLAGS; aFrom, aTo: AnsiString;
    Flags: FILEOP_FLAGS): Integer;
var
  FromPath, ToPath: AnsiString;
  SHFileOpStruct: TSHFileOpStruct;
begin
  FromPath := aFrom + #0#0;
  ToPath := aTo + #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
  Result := SHFileOperationA(SHFileOpStruct);
end;
.
.
.
procedure TForm2.ComboBox1Change(Sender: TObject);
var
dum : string;
begin
button1.Enabled := false;
//showmessage(trackinfo.path + ' - ' + form1.Edit1.Text+combobox1.Items.Strings[combobox1.itemindex]);
mediaplayer1.Close;
mediaplayer2.Close;
image1.Picture.LoadFromFile(ExtractFilePath(Application.ExeName)+'nopic.jpg');
image2.Picture.LoadFromFile(ExtractFilePath(Application.ExeName)+'nopic.jpg');
chdir(form1.Edit1.Text);

dum := form1.Edit1.Text+combobox1.Items.Strings[combobox1.itemindex];

//if movedir(dum, form1.Edit1.Text+combobox1.Items.Strings[combobox1.itemindex]) = true then
// showmessage('changed cat');
delete(trackinfo.path,length(trackinfo.path),1);

if dofilework(FO_move,trackinfo.path,dum,FOF_NOCONFIRMATION) = 0 then
showmessage('changed cat');
trackinfo.path := form1.Edit1.Text+combobox1.Items.Strings[combobox1.itemindex] + '\';
trackinfo.cat := combobox1.Items.Strings[combobox1.itemindex];

chdir(trackinfo.path);
 button1.Enabled := true;

 close;
 form1.Show;
end;