IVsObjectList2::DoDragDrop Method (UInt32, IDataObject^, UInt32, UInt32)

 

Asks the given list item to handle a drag-and-drop operation.

Namespace:   Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)

int DoDragDrop(
	unsigned int index,
	IDataObject^ pDataObject,
	unsigned int grfKeyState,
	unsigned int% pdwEffect
)

Parameters

index
Type: System::UInt32

[in] Specifies the index of the list item of interest.

pDataObject
Type: Microsoft.VisualStudio.OLE.Interop::IDataObject^

[in] Pointer to an IDataObject being dropped.

grfKeyState
Type: System::UInt32

[in] Current state of the keyboard and the mouse modifier keys.

pdwEffect
Type: System::UInt32

[in, out] On input, the effect being requested. On output, the effect that your object list allows.

Return Value

Type: System::Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

From vsshell80.idl:

[C++]

HRESULT IVsObjectList2::DoDragDrop(
   [in] ULONG Index, 
   [in] IDataObject * pDataObject, 
   [in] DWORD grfKeyState, 
   [in, out]DWORD * pdwEffect
);

The environment calls QueryDragDrop to see if your object list supports a drag-drop operation. If you return the call indicating that you do support the requested operation, and the user drops pDataObject by releasing the mouse button, the environment calls DoDragDrop. You must then handle the requested action and return the effect in pdwEffect.

This method is very similar to the standard COM Drop method. Values for grfKeyState can be a bitwise "or" combination of any number of the following: MK_CONTROL, MK_SHIFT, MK_ALT, MK_LBUTTON, MK_MBUTTON, and MK_RBUTTON. Values for the pdwEffect are taken from the DROPEFFECT enumeration.

Return to top
Show: