Fivecord 0 Posted December 18, 2021 My application is working as Remote Desktop Application. I want the user to copy files (jpg, word, excel, pdf) and paste them in my application, where the files will be processed in blobfields. I found some code to get al the filenames in the clipboard, which works fine, but on the RD you cannot access the users local storage, thus I'm not able to read the file from the original location. How dow I get the data + filename of each file (assuming it is possible to copy-paste multiple files) from the clipboard to storage them in a blobfield? The code I found to get the filenames: var f: THandle; buffer: Array [0..MAX_PATH] of Char; i, numFiles: Integer; begin Clipboard.Open; try f := Clipboard.GetAsHandle(CF_HDROP); if f <> 0 then begin DragQueryFile numFiles := DragQueryFile(f, $FFFFFFFF, nil, 0); for i:= 0 to numfiles - 1 do begin buffer[0] := #0; DragQueryFile( f, i, buffer, sizeof(buffer)); if FileExists(buffer) then begin //process file end; end; end; finally Clipboard.close; end; end; Share this post Link to post
PeterBelow 238 Posted December 18, 2021 Google for "ole drag and drop delphi", that may turn up something useful. Share this post Link to post
Anders Melander 1783 Posted December 18, 2021 This should get you started: https://github.com/landrix/The-Drag-and-Drop-Component-Suite-for-Delphi/tree/master/Demos/VirtualFileStream Share this post Link to post