Shell32SHDoDragDrop Method

Executes a drag-and-drop operation. Supports drag source creation on demand, as well as drag images.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Shell32.dll")]
public static HResult SHDoDragDrop(
	IntPtr hWnd,
	IDataObject dataObject,
	[OptionalAttribute] IDropSource dropSource,
	DragDropEffects effect,
	ref DragDropEffects refEffect
)

Parameters

hWnd  IntPtr
The handle of the window used to obtain the drag image. This value can be Zero.
dataObject  IDataObject
A IDataObject interface on a data object that contains the data being dragged.
dropSource  IDropSource  (Optional)
A IDropSource interface, which is used to communicate with the source during the drag operation. If this value is , the shell creates a drop source object for you.
effect  DragDropEffects
The effects that the source allows in the drag-and-drop operation. The most significant effect is whether the drag-and-drop operation permits a move. For a list of possible values, see DROPEFFECT.
refEffect  DragDropEffects
A value that indicates how the drag-and-drop operation affected the source data.

The parameter is set only if the operation is not canceled.

Return Value

HResult
If the drag-and-drop operation was successful, returns DRAGDROP_S_DROP.

If the drag-and-drop operation was canceled, returns DRAGDROP_S_CANCEL.

If an error occurs, returns a HResult error code.

Remarks

See Also