Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

IVsUIHierWinClipboardHelper Interface

Coordinates clipboard operations between hierarchies in a UI hierarchy window.

Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in microsoft.visualstudio.shell.interop.dll)

<InterfaceTypeAttribute(1)> _
<GuidAttribute("DF29D855-D0EC-4DA1-BCC3-42FA3A09B1CB")> _
Public Interface IVsUIHierWinClipboardHelper
Dim instance As IVsUIHierWinClipboardHelper

/** @attribute InterfaceTypeAttribute(1) */ 
/** @attribute GuidAttribute("DF29D855-D0EC-4DA1-BCC3-42FA3A09B1CB") */ 
public interface IVsUIHierWinClipboardHelper
public interface IVsUIHierWinClipboardHelper

Any hierarchy that wishes to coordinate its clipboard operations with other hierarchies should implement IVsUIHierWinClipboardHelperEvents and register to receive notification of clipboard events by calling AdviseClipboardHelperEvents.

The following is an example of a typical cut-and-paste sequence between hierarchies:

  1. The user performs a cut of a project item from a project hierarchy.

  2. The source project creates an IDataObject containing the data in CF_VSPROJECTITEMS format (similar to the CF_HDROP format). In addition to passing the IDataObject to OLE, the source hierarchy also passes it to the environment via the Cut method.

  3. The source project changes the appearance of the cut item by calling ExpandItem and specifying a value of either EXPF_CutHighlightItem or EXPF_AddCutHighlightItem, as appropriate.

  4. The user performs a paste of the project item.

  5. The destination project handles the contents of the IDataObject, and then communicates that a paste occurred by calling Paste.

  6. When its Paste method is called, the IVsUIHierWinClipboardHelper interface iterates through the list of hierarchies that have called AdviseClipboardHelperEvents and calls OnPaste on each. When the source project is called in this way, it should complete the cut by deleting the cut item from its hierarchy.

The IVsUIHierWinClipboardHelper interface is also a clipboard watcher, so when the contents of the clipboard change, and the cut IDataObject is no longer on the clipboard, the OnClear method of each listener is called. This way, the cut item can be undimmed by calling ExpandItem and specifying a value of EXPF_UnCutHighlightItem. In a copy situation, the item need not be dimmed since it has not been cut.

See illustrations of the implementation and/or calling of this interface in the sample Basic Project Sample.

Notes to Implementers Implemented by the environment.

Notes to Callers Called by hierarchies that support cut, copy, and paste operations.

Community Additions

© 2015 Microsoft