procedure CopyFilesToClipboard(FileList: string);
var
DropFiles: PDropFiles;
hGlobal: Thandle;
iLen: Integer;
begin
iLen := Length(FileList) * SizeOf(Char) + 2;
FileList := FileList + #0#0;
hGlobal := GlobalAlloc(GMEM_SHARE or GMEM_MOVEABLE or GMEM_ZEROINIT, SizeOf(TDropFiles) + iLen);
if (hGlobal = 0) then
raise Exception.Create('Could not allocate memory.');
begin
DropFiles := GlobalLock(hGlobal);
DropFiles^.pFiles := SizeOf(TDropFiles);
DropFiles^.pt.X := 0;
DropFiles^.pt.Y := 0;
DropFiles^.fNC := False;
DropFiles^.fWide := true;
Move(FileList[1], (PAnsiChar(DropFiles) + SizeOf(TDropFiles))^, iLen);
GlobalUnlock(hGlobal);
ClipBoard.SetAsHandle(CF_HDROP, hGlobal);
end;
end;
CopyFilesToClipboard('D:\设计师结算\2019年\已结算账单\123.txt');
procedure CutOrCopyFi