其他分享
首页 > 其他分享> > Delphi 获取剪切板复制的多个文件路径

Delphi 获取剪切板复制的多个文件路径

作者:互联网

uses
Clipbrd, ShellAPI;
var FFileName: array[0..MAX_PATH] of Char; FileNumber,i:Integer; Drop:Cardinal; begin if Clipboard.HasFormat(CF_HDROP ) then begin Drop := Clipboard.GetAsHandle(CF_HDROP); // file://首先查询用户选中的文件的个数 FileNumber := DragQueryFile(Drop, $FFFFFFFF,nil,0); // file://循环读取,将所有用户选中的文件保存到FileList中 for i:=0 to FileNumber-1 do begin DragQueryFile(Drop, i, FFileName, SizeOf(FFileName)); mmo1.Lines.Add(FFileName); end; end;

 

标签:begin,Delphi,Drop,FFileName,HDROP,复制,Clipboard,剪切板,FileNumber
来源: https://www.cnblogs.com/BTag/p/16462565.html