Difference between revisions of "File Into Trash/de"
From Free Pascal wiki
Jump to navigationJump to searchm (Fixed syntax highlighting; deleted category included in page template) |
|||
Line 1: | Line 1: | ||
{{File Into Trash}} | {{File Into Trash}} | ||
− | + | ||
− | Zurück zur Seite [[code examples/de|Code Beispiele]]. | + | |
− | + | Zurück zur Seite [[code examples/de|Code Beispiele]]. | |
− | Dieser Artikel beschäftigt sich mit der Windowsprogrammierung. | + | |
− | Die Funktion verschiebt eine Datei in den Papierkorb. | + | |
− | + | Dieser Artikel beschäftigt sich mit der Windowsprogrammierung. | |
− | <syntaxhighlight> | + | |
+ | Die Funktion verschiebt eine Datei in den Papierkorb. | ||
+ | |||
+ | <syntaxhighlight lang=pascal> | ||
uses | uses | ||
ShellAPI, FileUtil, ...; | ShellAPI, FileUtil, ...; | ||
Line 16: | Line 19: | ||
Dateistruktur: TSHFileOpStruct; | Dateistruktur: TSHFileOpStruct; | ||
begin | begin | ||
− | |||
FillChar(Dateistruktur, SizeOf(Dateistruktur), 0); | FillChar(Dateistruktur, SizeOf(Dateistruktur), 0); | ||
Line 28: | Line 30: | ||
Result := ShFileOperation(Dateistruktur) = 0; | Result := ShFileOperation(Dateistruktur) = 0; | ||
− | |||
end; | end; | ||
Line 34: | Line 35: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 04:50, 15 February 2020
Dieser Artikel behandelt ausschließlich Windows.
Siehe auch: Multiplatform Programming Guide/de
│
Deutsch (de) │
English (en) │
Zurück zur Seite Code Beispiele.
Dieser Artikel beschäftigt sich mit der Windowsprogrammierung.
Die Funktion verschiebt eine Datei in den Papierkorb.
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;
...