Shell32SHDoDragDrop Method
Executes a drag-and-drop operation. Supports drag source creation on demand, as well as drag images.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("Shell32.dll">]
Public Shared Function SHDoDragDrop (
hWnd As IntPtr,
dataObject As IDataObject,
<OptionalAttribute> dropSource As IDropSource,
effect As DragDropEffects,
ByRef refEffect As DragDropEffects
) As HResult
Dim hWnd As IntPtr
Dim dataObject As IDataObject
Dim dropSource As IDropSource
Dim effect As DragDropEffects
Dim refEffect As DragDropEffects
Dim returnValue As HResult
returnValue = Shell32.SHDoDragDrop(hWnd,
dataObject, dropSource, effect, refEffect)
public:
[DllImportAttribute(L"Shell32.dll")]
static HResult SHDoDragDrop(
IntPtr hWnd,
IDataObject^ dataObject,
[OptionalAttribute] IDropSource^ dropSource,
DragDropEffects effect,
DragDropEffects% refEffect
)
[<DllImportAttribute("Shell32.dll")>]
static member SHDoDragDrop :
hWnd : IntPtr *
dataObject : IDataObject *
[<OptionalAttribute>] dropSource : IDropSource *
effect : DragDropEffects *
refEffect : DragDropEffects byref -> HResult
No code example is currently available or this language may not be supported.
- 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.
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.