首页  编辑  

复制文本到剪贴版和从剪贴版取文字

Tags: /超级猛料/OS.操作系统/Clipboard.剪贴板/   Date Created:

uses ClipBrd;

procedure StrToClipbrd(StrValue: string);

var

 A: array[0..255] of char;

begin

 StrPCopy(A, StrValue);

 Clipboard.SetTextBuf(A);

end;

function GetStrFromClipbrd : string;

begin

if Clipboard.HasFormat(CF_TEXT) then

  result := Clipboard.AsText

else

begin

 ShowMessage('There is no text in the Clipboard!');

 result := '';

end;

end;