Recent

Author Topic: [SOLVED] VST add multiple file  (Read 217 times)

Pe3s

  • Full Member
  • ***
  • Posts: 248
[SOLVED] VST add multiple file
« on: August 18, 2022, 05:56:55 pm »
Hello, com forumers I have to change the code to add more files to the VST in the opendialog multiselect is set
Code: Pascal  [Select][+][-]
  1. procedure TForm1.SpeedButton1Click(Sender: TObject);
  2. var
  3.   Node: PVirtualNode;
  4.   Data: PData;
  5.   i: Integer;
  6. begin
  7.   if OpenDialog1.Execute then
  8.   begin
  9.     VST.NodeDataSize := SizeOf(TData);
  10.     Node := VST.AddChild(nil);
  11.     Data := VST.GetNodeData(Node);
  12.     for i := 0 to OpenDialog1.Files.Count -1 do
  13.     Data^.PATH := ExtractFilePath(OpenDialog1.files[i]);
  14.     Data^.FImage := ExtractFileName(OpenDialog1.Files[i]);
  15.   end;
  16. end;
« Last Edit: August 18, 2022, 08:48:06 pm by Pe3s »

paweld

  • Sr. Member
  • ****
  • Posts: 462
Re: VST add multiple file
« Reply #1 on: August 18, 2022, 06:50:18 pm »
Code: Pascal  [Select][+][-]
  1. procedure TForm1.SpeedButton1Click(Sender: TObject);
  2. var
  3.  
  4.   Node: PVirtualNode;
  5.   Data: PData;
  6.   i: Integer;
  7. begin
  8.  
  9.   if OpenDialog1.Execute then  begin    VST.NodeDataSize := SizeOf(TData);    for i := 0 to OpenDialog1.Files.Count -1 do
  10.     begin
  11.       Node := VST.AddChild(nil);  
  12.  
  13.       Data := VST.GetNodeData(Node);
  14.       Data^.PATH := ExtractFilePath(OpenDialog1.files[i]);
  15.       Data^.FImage := ExtractFileName(OpenDialog1.Files[i]);
  16.     end;
  17.   end;
  18. end;
Best regards
paweld

Pe3s

  • Full Member
  • ***
  • Posts: 248
Re: [SOLVED] VST add multiple file
« Reply #2 on: August 18, 2022, 08:48:28 pm »
@paweld Thank you :)

 

TinyPortal © 2005-2018