GetClipboardData_() #CF_HDROP
Verfasst: 01.10.2009 19:09
Kann bestimmt der ein oder andere gebrauchen.
Liest aus der Zwischenablage die Kopierten Dateipfade aus.
Liest aus der Zwischenablage die Kopierten Dateipfade aus.
Code: Alles auswählen
EnableExplicit
; Ermitelt die Anzahl an Dateipfade
Procedure.i Clipboard_GetFileCount()
If OpenClipboard_(0)
Protected iClipboard.i
Protected iAmount.i
iClipboard = GetClipboardData_(#CF_HDROP)
If iClipboard
iAmount = DragQueryFile_(iClipboard, $FFFFFFFF, 0, 0)
EndIf
CloseClipboard_()
ProcedureReturn iAmount
EndIf
EndProcedure
; Ergibt einen String der die Dateinamen getrennt mit | enthält
Procedure.s Clipboard_GetFileList()
If OpenClipboard_(0)
Protected hClipboard.i
Protected Buffer.s = Space(#MAX_PATH)
Protected Amount.i
Protected i.i
Protected sResult.s
hClipboard = GetClipboardData_(#CF_HDROP)
If hClipboard
Amount = DragQueryFile_(hClipboard, $FFFFFFFF, 0, 0)
For i = 0 To Amount - 1
DragQueryFile_(hClipboard, i, @Buffer, #MAX_PATH)
If Buffer
sResult + Buffer
If Amount - 1 > i
sResult + "|"
EndIf
EndIf
Next
EndIf
CloseClipboard_()
ProcedureReturn sResult
EndIf
EndProcedure