📄 cpclip.pas
字号:
{*******************************************************************
* *
* COMPONENT for MS DOS and Windows source code. *
* *
* (c) 1992, Roderic D. M. Page *
* *
* Language: Turbo Pascal (Pascal with object-oriented extensions) *
* Compiler: Turbo Pascal 6.0 (MS DOS) *
* Turbo Pascal for Windows 1.0 (WINDOWS) *
* *
* Notes: Program interface is currently Windows specific. *
* *
*******************************************************************}
{* Basic clipboard operations *}
{* Written 16 Oct 1992 *}
unit cpclip;
interface
uses
WinTypes,
WinProcs,
Strings;
function CopyTextToClipboard (TextString: PChar):Boolean;
implementation
{ Copy TextString to Windows Clipboard }
function CopyTextToClipboard (TextString: PChar):Boolean;
var
StringGlobalHandle : TGlobalHandle;
StringGlobalPtr : PChar;
begin
CopyTextToClipboard := False;
StringGlobalHandle := GlobalAlloc (gHnd, Strlen (TextString) + 1);
if (StringGlobalHandle <> 0) then begin
StringGlobalPtr := GlobalLock (StringGlobalHandle);
if (StringGlobalPtr <> NIL) then begin
StrCopy (StringGlobalPtr, TextString);
GlobalUnlock (StringGlobalHandle);
SetClipboardData (cf_Text, StringGlobalHandle);
CopyTextToClipboard := True;
end
else GlobalFree (StringGlobalHandle);
end
else GlobalFree (StringGlobalHandle);
end;
begin
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -