IVsObjectList2.GetClipboardFormat 方法

定义

要求给定的列表项呈现它所支持的特定剪贴板格式。

public:
 int GetClipboardFormat(System::UInt32 index, System::UInt32 grfFlags, cli::array <Microsoft::VisualStudio::OLE::Interop::FORMATETC> ^ pFormatetc, cli::array <Microsoft::VisualStudio::OLE::Interop::STGMEDIUM> ^ pMedium);
int GetClipboardFormat(unsigned int index, unsigned int grfFlags, std::Array <Microsoft::VisualStudio::OLE::Interop::FORMATETC> const & pFormatetc, std::Array <Microsoft::VisualStudio::OLE::Interop::STGMEDIUM> const & pMedium);
public int GetClipboardFormat (uint index, uint grfFlags, Microsoft.VisualStudio.OLE.Interop.FORMATETC[] pFormatetc, Microsoft.VisualStudio.OLE.Interop.STGMEDIUM[] pMedium);
abstract member GetClipboardFormat : uint32 * uint32 * Microsoft.VisualStudio.OLE.Interop.FORMATETC[] * Microsoft.VisualStudio.OLE.Interop.STGMEDIUM[] -> int
Public Function GetClipboardFormat (index As UInteger, grfFlags As UInteger, pFormatetc As FORMATETC(), pMedium As STGMEDIUM()) As Integer

参数

index
UInt32

中指定感兴趣的列表项的索引。

grfFlags
UInt32

中指定多选。 值取自 _VSOBJCFFLAGS 枚举。

pFormatetc
FORMATETC[]

中指向 FORMATETC 包含剪贴板格式信息的结构的指针。

pMedium
STGMEDIUM[]

中指向 STGMEDIUM 结构的指针,该结构表示数据传输媒体。

返回

Int32

如果该方法成功,则它会返回 S_OK。 如果该方法失败,则会返回错误代码。

注解

COM 签名

从 vsshell80:

[C++]

HRESULT IVsObjectList2::GetClipboardFormat(  
   [in] ULONG Index,   
   [in] VSOBJCFFLAGS grfFlags,   
   [in] FORMATETC *pFormatetc,   
   in] STGMEDIUM *pMedium  
);  

当用户对对象列表中的项请求复制粘贴或拖放操作时,环境将调用 EnumClipboardFormats 以查看列表支持的格式。 然后,在 GetClipboardFormat 实际的粘贴或删除操作发生时,环境会调用项。 然后以请求的格式呈现项。

适用于