Shell Interfaces


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.

IDragSourceHelper Members

InitializeFromBitmap Initializes the drag-image manager for a windowless control.
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 and IDropTargetHelper 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  Windows Vista and later: Prior to Windows Vista this interface was declared in Shlobj.h.

Interface Information

Minimum DLL Versionshell32.dll version 5.0 or later
Custom ImplementationYes
Inherits fromIUnknown
Header and IDL filesshobjidl.h, shobjidl.idl
Minimum operating systems Windows 2000, Millennium
Tags :


Page view tracker