Show clipboard's content

This example shows how to view clipboard contents as text or bitmap:

uses Clipboard;
...
procedure TForm1.Button1Click(Sender: TObject);
var
  MyHandle: THandle;
begin
  Clipboard.Open;
  if Clipboard.HasFormat(CF_TEXT) then
  begin
    MyHandle:=Clipboard.GetAsHandle(CF_TEXT);
    Memo1.Lines.Add(StrPas(GlobalLock(MyHandle)));
    GlobalUnlock(MyHandle);
  end;
  if (Clipboard.HasFormat(CF_BITMAP)) or
    (Clipboard.HasFormat(CF_PICTURE)) then
    Image1.Picture.Assign(Clipboard);
  Clipboard.Close;
end;