怎么将一窗体以图片形式 以及 一段文字 一块复制到剪贴板中

如何将一窗体以图片形式 以及 一段文字 一块复制到剪贴板中
现有一个窗体,其上有三个文本框,现要求将窗体以图片形式复制到剪贴板中,并且将此窗体上的三个文本框中的文字也复制到剪贴板中,两者都要同时存放在剪贴板中,以便于一块粘贴到某个地方。

------解决思路----------------------
使用bitblt对窗体进行截图.....
------解决思路----------------------
据我所知,虽然剪贴板可以装很多种东西,但是同一时刻只能装一种东西,要么是文本,要么是图片!
如果你想同时既要保存文本同时还要保存图片,我想那是做不到的。

不知道楼主想干嘛!
如果要进程内传递,可以用公用变量;如果是进程间传递,也可以有很多方法来完成的....
------解决思路----------------------
引用:
据我所知,虽然剪贴板可以装很多种东西,但是同一时刻只能装一种东西,要么是文本,要么是图片!
如果你想同时既要保存文本同时还要保存图片,我想那是做不到的。

不知道楼主想干嘛!
如果要进程内传递,可以用公用变量;如果是进程间传递,也可以有很多方法来完成的....


非常感谢,但是大家都知道,当我们可以一次性的把一个网页中的图片和文字同时复制粘贴到WORD中呀,可不是一次只能操作一种东西呀。
------解决思路----------------------
以前还真没注意,实验了一下,还是可以单独处理的嘛。
参考:
Option Explicit
Private Sub Command1_Click()
    If Clipboard.GetFormat(vbCFText) Then
        ''检查剪贴板是否有文本内容
        Text1.Text = Clipboard.GetText(vbCFText)
    End If
    If Clipboard.GetFormat(vbCFBitmap) Then
        ''检查剪贴板是否有图片
        Set Pic.Picture = Clipboard.GetData(vbCFBitmap)
    End If
End Sub
Private Sub Form_Load()
    Clipboard.Clear ''清空剪贴板
    ''将一段文字复制到剪贴板
    Clipboard.SetText "w12345", vbCFText
    ''将一图片复制到剪贴板
    Clipboard.SetData LoadPicture("d:\000.gif"), vbCFBitmap
End Sub




不知道word是怎么处理的.......怎么将一窗体以图片形式 以及 一段文字 一块复制到剪贴板中
------解决思路----------------------
貌似分开放的。文本和图在剪贴板中。
------解决思路----------------------
可以同时复制, 但是和网页的图文混排是不一样的. 
在剪贴板获得了文本和图像之后,你可以在自己的程序中分别把它们粘贴出来.
但是离开了你的程序, 你在其他程序中"ctrl+v"只能贴出其中的一样来, 这取决于该程序接收的数据格式是图像或文本或是其他什么格式了.
想要粘贴文本和图像到其他程序的话, 必须使用RTF格式, VB中的富文本控件直接支持此种格式.

当然, 如果只有单独分开的文本和图片,想变成RTF格式的话, 你得自己去查资料手工代码构建了. 极其麻烦的一件事.
------解决思路----------------------
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