File Into Trash/de: what changed
Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 2 | - | ||
| 3 | - | ||
| 1 | + | Zurück zur Seite [[code examples/de|Code Beispiele]]. | |
| 4 | 2 | ||
| 5 | - | ||
| 3 | + | Dieser Artikel beschäftigt sich mit der Windowsprogrammierung. | |
| 6 | 4 | ||
| 7 | - | ||
| 8 | - | ||
| 5 | + | Die Funktion verschiebt eine Datei in den Papierkorb. | |
| 9 | 6 | ||
| 7 | + | ``` pascal | |
| 8 | + | uses | |
| 9 | + | ShellAPI, FileUtil, ...; | |
| 10 | 10 | ||
| 11 | - | ||
| 12 | - | ||
| 11 | + | ... | |
| 13 | 12 | ||
| 14 | - | ||
| 13 | + | function funDateiInPapierkorbVerschieben(strDateiname: string): boolean; | |
| 14 | + | var | |
| 15 | + | Dateistruktur: TSHFileOpStruct; | |
| 16 | + | begin | |
| 17 | + | FillChar(Dateistruktur, SizeOf(Dateistruktur), 0); | |
| 15 | 18 | ||
| 16 | - | ||
| 17 | - | ||
| 18 | - | ||
| 19 | - | ||
| 20 | - | ||
| 21 | - | ||
| 22 | - | ||
| 23 | - | ||
| 24 | - | ||
| 25 | - | ||
| 26 | - | ||
| 27 | - | ||
| 28 | - | ||
| 29 | - | ||
| 30 | - | ||
| 31 | - | ||
| 32 | - | ||
| 33 | - | ||
| 34 | - | ||
| 35 | - | ||
| 36 | - | ||
| 37 | - | ||
| 38 | - | ||
| 39 | - | ||
| 40 | - | ||
| 19 | + | with Dateistruktur do | |
| 20 | + | begin | |
| 21 | + | wFunc := FO_DELETE; | |
| 22 | + | // Lässt Umlaute usw. im Dateinamen zu | |
| 23 | + | pFrom := PChar(UTF8ToSys(strDateiname)); | |
| 24 | + | fFlags := FOF_ALLOWUNDO + FOF_NOCONFIRMATION + FOF_SILENT; | |
| 25 | + | end; | |
| 26 | + | ||
| 27 | + | Result := ShFileOperation(Dateistruktur) = 0; | |
| 28 | + | end; | |
| 29 | + | ||
| 30 | + | ... | |
| 31 | + | ||
| 41 | 32 | ``` | |
| 42 | 33 | ||
| 43 | 34 | --- | |
| 44 | - | ||
| 35 | + | *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](/wiki-contact).* |
