现有一个窗体,其上有三个文本框,现要求将窗体以图片形式复制到剪贴板中,并且将此窗体上的三个文本框中的文字也复制到剪贴板中,两者都要同时存放在剪贴板中

loenglishsh 2014-12-22 02:01:58
现有一个窗体,其上有三个文本框,现要求将窗体以图片形式复制到剪贴板中,并且将此窗体上的三个文本框中的文字也复制到剪贴板中,两者都要同时存放在剪贴板中,以便于一块粘贴到某个地方。
...全文
125 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2014-12-23
  • 打赏
  • 举报
回复
调用RegisterClipboardFormat的例子代码一瞥: MSDN98\SAMPLES\VC98\SDK\SDKTOOLS\IMAGEDIT\IMAGEDIT.C MSDN98\SAMPLES\VC98\SDK\SDKTOOLS\WINNT\DLGEDIT\DLGEDIT.C MSDN98\SAMPLES\VC98\SDK\WINUI\COMCTL\REITP\REITP.C MSDN98\SAMPLES\VC98\SDK\WINUI\SHELL\DROPEXT\DROPEXT.C Microsoft SDK\samples\winui\Controls\RichEdit\Reitp.c Microsoft SDK\samples\winui\Shell\DropExt\DropExt.C Microsoft SDK\samples\winui\Shell\DragImg\DragImg.Cpp Microsoft SDK\samples\winui\Shell\SampView\ContMenu.Cpp Microsoft SDK\samples\winui\Shell\SampView\DataObj.Cpp Microsoft SDK\samples\winui\Shell\SampView\DropTgt.Cpp Microsoft SDK\samples\winui\Shell\SampView\ShlView.Cpp
loenglishsh 2014-12-23
  • 打赏
  • 举报
回复
引用 1 楼 zhao4zhong1 的回复:
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 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
非常感谢,但是就没有个现成的代码吗?
赵4老师 2014-12-22
  • 打赏
  • 举报
回复
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 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

16,372

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

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