本文整理自网络,侵删。
调用单元:uses Clipbrd;procedure TForm1.Button4Click(Sender: TObject);var s: string; hMem: DWORD; CF_HTML: DWORD; // 声明一个CF_HTML剪贴板格式 txtPtr: Pansichar;begin CF_HTML := RegisterClipboardFormat('HTML Format'); //注册HTML Format格式 with TClipboard.Create do begin hMem := GetAsHandle(CF_HTML); txtPtr := GlobalLock(hMem); s := StrPas(txtPtr); GlobalUnlock(hMem); Memo1.Lines.Add(UF8Decode(s)); Free; end;end;
相关阅读 >>
Delphi 用 getenvironmentvariable 获取常用系统环境变量
Delphi fdconnection查看所有表包含用户表和系统表
更多相关阅读请进入《Delphi》频道 >>