给你一个例子,不要忘记给分,什么东西都可以的<br>unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes,<br> Graphics, Controls, Forms, Dialogs,<br> Clipbrd;<br>type<br> TForm1 = class(TForm)<br> procedure FormCreate(Sender: TObject);<br>procedure FormClose(Sender: TObject;<br> var Action: TCloseAction);<br> private<br> { Private declarations }<br> public<br> NextClipHwnd:HWND<br>procedure WMDrawClipBoard(var AMessage:TMessage);message WM_DRAWCLIPBOARD;//这一个你应该明白吧<br><br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.DFM}<br><br>{ TForm1 }<br><br>procedure TForm1.WMDrawClipBoard(var AMessage: TMessage);<br>begin<br>SendMessage(NextClipHwnd,AMessage.Msg,AMessage.WParam,AMessage.LParam);<br> <br> if (Clipboard.HasFormat(CF_TEXT) or<br> Clipboard.HasFormat(CF_OEMTEXT)) then<br> begin<br> <br> Caption:=Clipboard.asText;<br> end;<br>end;<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> <br> NextClipHwnd:=SetClipBoardViewer(Handle);<br>end;<br><br>procedure TForm1.FormClose<br>(Sender: TObject; var Action: TCloseAction);<br>begin<br> ChangeClipboardChain(Handle,NextClipHwnd);<br> SendMessage(NextClipHwnd,WM_CHANGECBCHAIN,Handle,NextClipHwnd);<br>end;<br><br>end.<br><br>