formhook OnDropFiles example
Return to Introduction 
Following code demonstrates how to handle OnDropFiles event and hook the names of files dropped onto form.

procedure TMainForm.acFormHookDropFiles(Files: TStrings;
  const Pos: TPoint);
var
  I: Integer;
begin
  I := Files.Count;
  if I <> 0
 then
   for I := 0
 to I - 1 do
    begin
     if FileExists(Files[I]) then
       AddFile(Files[I]) // AddFile is imaginary procedure

     else
      if DirectoryExists(Files[I]) then
        AddFolder(Files[I]);  // AddFolder is imaginary procedure

    end;
end;