处理WM_DRAWCLIPBOARD消息过程
处理WM_DRAWCLIPBOARD消息过程
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,Clipbrd, StdCtrls, Vcl.ExtCtrls, Vcl.Buttons;
type
TForm1 = class(TForm)
Memo1: TMemo;
Panel1: TPanel;
Button1: TButton;
Label1: TLabel;
保存: TButton;
SaveDialog1: TSaveDialog;
clear: TBitBtn;
ckBox_AutoPaste: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Button1Click(Sender: TObject);
procedure 保存Click(Sender: TObject);
procedure clearClick(Sender: TObject);
private
{ Private declarations }
public
NextClipHwnd:HWND;//观察链中下一个窗口句柄
procedure WMDrawClipBoard
(var AMessage:TMessage);
message WM_DRAWCLIPBOARD;
//处理WM_DRAWCLIPBOARD消息过程
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WMDrawClipBoard(var AMessage: TMessage);
begin
//将WM_DRAWCLIPBOARD消息传递到下一个观察链中的窗口
SendMessage(NextClipHwnd,AMessage.Msg,AMessage.WParam,AMessage.LParam);
//查询剪贴板中特定格式的数据内容
if (Clipboard.HasFormat(CF_TEXT) or Clipboard.HasFormat(CF_OEMTEXT)) then
begin
//处理剪贴板中内容
if ckBox_AutoPaste.Checked then
begin
//Caption:=Clipboard.asText;
Memo1.Text:=Memo1.Text+#13#10+ Clipboard.asText;
end;
end;
end;
查看评论 回复
"处理WM_DRAWCLIPBOARD消息过程"的相关文章
热门文章
- 空格后面的作为标题 ___delphi___
- 要处理的文件总行数 ___delphi___
- function TrimString(str:string):string; ___delphi_
- 把要处理的文件装入到memo1_test中,启动处理定时器ti
- 读入的内容写到Memo1_Test显示出来,测试用 ___delphi_
- textarea不能使用以下方式 ___delphi___
- 随机发布文章到栏目类别 ___delphi___
- 用pos函数来判断,在下面这一行怎么会出错呢? ___del
- delphi什么函数能判断一个字符串包含在另一字符串 ___
- delphi怎样判断字符串包含指定字符 ___delphi___