Sign in Join
Wiki copytemporary

Revision 3 of 3, by WikiArchive on 11-4-2026. The page as it is now.

File Into Trash/de

Zurück zur Seite Code Beispiele.

Dieser Artikel beschäftigt sich mit der Windowsprogrammierung.

Die Funktion verschiebt eine Datei in den Papierkorb.

pascal
uses
  ShellAPI, FileUtil, ...;
  
  ...
  
function funDateiInPapierkorbVerschieben(strDateiname: string): boolean;
var
  Dateistruktur: TSHFileOpStruct;
begin
  FillChar(Dateistruktur, SizeOf(Dateistruktur), 0);

  with Dateistruktur do
  begin
    wFunc := FO_DELETE;
    // Lässt Umlaute usw. im Dateinamen zu
    pFrom := PChar(UTF8ToSys(strDateiname));
    fFlags := FOF_ALLOWUNDO + FOF_NOCONFIRMATION + FOF_SILENT;
  end;

  Result := ShFileOperation(Dateistruktur) = 0;
end;
  
  ...

From the Free Pascal wiki, page "File Into Trash/de", as it stood on 2020-02-15 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.