Delphi Drawers

複数のドラッグファイルのパスを取得

ドラッグされた複数のファイルのファイルパスを取得します。

function fnGetDragFilePathList(var stlFileList:TStringList):integer;
var
  strPath:string;
  iIdx:integer;
begin
  stlFileList := TStringList.Create;
  stlFileList.Clear;
  case Paramcount of
    0:Result := -2;
    else Result := 1;
  end;
  if Result = 1 then begin
    for iIdx := 1 To ParamCount do begin
      strPath := ParamStr(iIdx);
      if not FileExists(strPath) then begin
        Result := -4;
      end else begin
        stlFileList.Add(strPath);
      end;
    end;
  end;
end;
Copyright © 2006 Hikijishi All Rights Reserved.
[] [delphi][0.00220394134521484]