如何在windows剪贴板中追加内容

dahua010 2014-12-30 10:49:32
如题。
意思就是如果我操作了剪贴板添加了一些内容。比如图片

.....
//创建位图
::SetClipboardData(CF_BITMAP, hBitmap); //hBitmap 为与设备相关的位图
::SetClipboardData(CF_UNICODETEXT, hMen); //hBitmap 为刚才的屏幕位图句柄
::CloseClipboard();//关闭剪贴板


之后我还想在追加一些文字进去,如上写的::SetClipboardData(CF_UNICODETEXT, hMen);
但是我发现文字是追加不进去的。。

我就是想实现,现在剪贴板中放一张图片,之后可能在追加一些文字等等的这种操作。我该如何编辑剪贴板?
求助啊!

从新描述下问题。。。 我打算实现的功能类似,我加载一段文字和一些图像到剪贴板,之后再我的richedit执行黏贴操作。这些文字和图像就被复制到我的编辑框中了。
...全文
247 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2014-12-30
  • 打赏
  • 举报
回复
Clipboard Functions Following are the functions used with the clipboard. ChangeClipboardChain CloseClipboard CountClipboardFormats EmptyClipboard EnumClipboardFormats GetClipboardData GetClipboardFormatName GetClipboardOwner GetClipboardSequenceNumber GetClipboardViewer GetOpenClipboardWindow GetPriorityClipboardFormat IsClipboardFormatAvailable OpenClipboard RegisterClipboardFormat SetClipboardData SetClipboardViewer
赵4老师 2014-12-30
  • 打赏
  • 举报
回复
RegisterClipboardFormat The RegisterClipboardFormat function registers a new clipboard format. This format can then be used as a valid clipboard format. UINT RegisterClipboardFormat( LPCTSTR lpszFormat // address of name string ); Parameters lpszFormat Pointer to a null-terminated string that names the new format. Return Values If the function succeeds, the return value identifies the registered clipboard format. If the function fails, the return value is zero. To get extended error information, call GetLastError. Remarks If a registered format with the specified name already exists, a new format is not registered and the return value identifies the existing format. This enables more than one application to copy and paste data using the same registered clipboard format. Note that the format name comparison is case-insensitive. Registered clipboard formats are identified by values in the range 0xC000 through 0xFFFF. Windows CE: Windows CE supports only the Unicode version of RegisterClipboardFormat. QuickInfo Windows NT: Requires version 3.1 or later. Windows: Requires Windows 95 or later. Windows CE: Requires version 1.0 or later. Header: Declared in winuser.h. Import Library: Use user32.lib. Unicode: Implemented as Unicode and ANSI versions on Windows NT. See Also Clipboard Overview, Clipboard Functions, CountClipboardFormats, EnumClipboardFormats, GetClipboardFormatName
dahua010 2014-12-30
  • 打赏
  • 举报
回复
还是没法实现所有的richedit通用啊。。
赵4老师 2014-12-30
  • 打赏
  • 举报
回复
dahua010 2014-12-30
  • 打赏
  • 举报
回复
感谢楼上,但是我的意思是,我自己往剪贴板里的写的这种文字加图片的信息。可以在QQ,word,或者我自己的richedit使用粘贴的时候,把图片+文字可以copy进去。 如果自定义格式的话,只有我自己的程序能认识。 那我在QQ的输入框使用“粘贴”的时候,QQ是不认得。 我自己做过测试,我自己有一个IM聊天工具,我的文本输入框和QQ的一样,都属于RICHEDIT,这样,我在QQ的输入框中,输入文字+图片,之后复制,然后在我的文本输入框粘贴,我是可以完整显示的。 现在就是想自己对剪贴板进行操作,从一个文件中,读出一部分文字,在从硬盘中取一些图片,放到剪贴板,之后再QQ,或者是我自己的文本输入栏中"粘贴" 可以达到一样的效果。

64,646

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧