IDragSourceHelper interface

Exposed by the Shell to allow an application to specify the image that will be displayed during a Shell drag-and-drop operation.

Methods

The IDragSourceHelper interface has these methods.

Method Description
IDragSourceHelper::InitializeFromBitmap Initializes the drag-image manager for a windowless control.
IDragSourceHelper::InitializeFromWindow Initializes the drag-image manager for a control with a window.

Remarks

This interface is exposed by the Shell's drag-image manager. It is not implemented by applications.

Use this interface to specify the image displayed during a Shell drag-and-drop operation. The IDragSourceHelper, IDropTargetHelper, and IInitializeWithWindow interfaces are exposed by the drag-image manager object to allow the IDropTarget interface to use custom drag images. To use either of these interfaces, you must create an in-process server drag-image manager object by calling CoCreateInstance with a class identifier (CLSID) of CLSID_DragDropHelper. Get interface pointers using standard Component Object Model (COM) procedures.

The IDragSourceHelper interface provides the following two ways to specify the bitmap to be used as a drag image.

  • Controls that have a window can register a DI_GETDRAGIMAGE window message for it and initialize the drag-image manager with IDragSourceHelper::InitializeFromWindow. When the DI_GETDRAGIMAGE message is received, the handler puts the drag image bitmap information in the SHDRAGIMAGE structure that is passed as the message's lParam value.
  • Windowless controls can initialize the drag-image manager with IDragSourceHelper::InitializeFromBitmap. This method allows an application to simply specify the bitmap.
Note   The drag-and-drop helper object calls IDataObject::SetData to load private formats—used for cross-process support—into the data object. It later retrieves these formats by calling IDataObject::GetData. To support the drag-and-drop helper object, the data object's SetData and GetData implementations must be able to accept and return arbitrary private formats.
 
For further discussion of Shell drag-and-drop operations, see Transferring Shell Data Using Drag-and-Drop or the Clipboard.
Note   Prior to Windows Vista this interface was declared in Shlobj.h.
 

Requirements

   
Minimum supported client Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)