Einzelnen Beitrag anzeigen

Prototypjack

Registriert seit: 2. Feb 2003
611 Beiträge
 
Delphi 2009 Professional
 
#1

Context Menu, Mehrere Filenames übergeben

  Alt 7. Sep 2005, 07:27
Hallo,
Ich programmierer atm an einem Context Menu Handler.
Er ist bereits fertig und alles funktioniert wie geplant, bis auf eines. Er übergibt aus irgendeinem Grund nur einen Filename.
Ich verwende diesen Code zum bekommen der Filenames:
Delphi-Quellcode:
var
  StgMedium: TStgMedium;
  FormatEtc: TFormatEtc;
  i: Integer;
begin
  if lpdobj = nil then
  begin
    Result := E_INVALIDARG;
    Exit;
  end;
  with FormatEtc do
  begin
    cfFormat := CF_HDROP;
    ptd := nil;
    dwAspect := DVASPECT_CONTENT;
    lindex := -1;
    tymed := TYMED_HGLOBAL;
  end;
  Result := lpdobj.GetData(FormatEtc, StgMedium);
  if Failed(Result) then
    Exit;
{  for i := 0 to DragQueryFile(StgMedium.hGlobal, $FFFFFFFF, nil, 0) - 1 do
    DragQueryFile(StgMedium.hGlobal, i, FFilename, sizeof(FFilename));
  ReleaseStgMedium(StgMedium);
  Result := NOERROR;  }

  if (DragQueryFile(StgMedium.hGlobal, $FFFFFFFF, nil, 0) = 1) then begin
    DragQueryFile(StgMedium.hGlobal, 0, FFileName, SizeOf(FFileName));
    Result := NOERROR;
  end
  else begin
    FFileName[0] := #0;
    Result := E_FAIL;
  end;
  ReleaseStgMedium(StgMedium);
end;
Und später wird das Prog mit FFilename gestartet, aber es ist nur ein Filename drin und ich habe keine Ahnung woran es liegt und wie ich es ändern könnte.
Bitte um Hilfe & Guten Morgen!
Max
Max
„If you have any great suggestions, feel free to mail me, and I'll probably feel free to ignore you.“ . Linus Torvalds
  Mit Zitat antworten Zitat