Hi Leute!
Bin grade beim schreiben einer kleinen Funktion für ein Programm.
Ich möchte von meinem Programm aus eine Liste mit zwei Dateien/Dateinamen(?) in die Zwischenablage einfügen, sodass z.B. im Explorermenü nach einem Klick auf "Einfügen" die beiden Dateien dort entsprechend eingefügt werden.
Folgenden Ansatz habe ich bereits:
Delphi-Quelltext
1: 2: 3: 4: 5: 6:
| Clipboard.Open; try ClipBoard.SetAsHandle(CF_HDROP,DateienHandle); finally Clipboard.Close; end; |
In der Windows API-Hilfe steht folgendes:
| Zitat: |
The SetClipboardData [in Delphi gibbet dafür auch "SetAsHandle" in TClipboard] function places data on the clipboard in a specified clipboard format. The window must be the current clipboard owner, and the application must have called the OpenClipboard function. (When responding to the WM_RENDERFORMAT and WM_RENDERALLFORMATS messages, the clipboard owner must not call OpenClipboard before calling SetClipboardData.)
HANDLE SetClipboardData(
UINT uFormat, // clipboard format
HANDLE hMem // data handle
);
(...)
CF_HDROP: A handle of type HDROP that identifies a list of files. An application can retrieve information about the files by passing the handle to the DragQueryFile functions. |

Frage: Wie bekomme ich so einen Handler mit meinen zwei Dateien nun zustande? Oder ist mein Ansatz ganz falsch?
Danke schonmal und schöne Grüße,
RichMan
Moderiert von
Tino: Quote-Tags hinzugefügt.