Share via


IVsObjectList.QueryDragDrop Method

Returns a flag indicating whether the given list item supports a drag-and-drop operation.

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

Syntax

'Declaration
Function QueryDragDrop ( _
    index As UInteger, _
    pDataObject As IDataObject, _
    grfKeyState As UInteger, _
    <OutAttribute> ByRef pdwEffect As UInteger _
) As Integer
int QueryDragDrop(
    uint index,
    IDataObject pDataObject,
    uint grfKeyState,
    out uint pdwEffect
)
int QueryDragDrop(
    [InAttribute] unsigned int index, 
    [InAttribute] IDataObject^ pDataObject, 
    [InAttribute] unsigned int grfKeyState, 
    [InAttribute] [OutAttribute] unsigned int% pdwEffect
)
abstract QueryDragDrop : 
        index:uint32 * 
        pDataObject:IDataObject * 
        grfKeyState:uint32 * 
        pdwEffect:uint32 byref -> int
function QueryDragDrop(
    index : uint, 
    pDataObject : IDataObject, 
    grfKeyState : uint, 
    pdwEffect : uint
) : int

Parameters

  • index
    Type: System.UInt32

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

  • 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.

Remarks

COM Signature

From vsshell.idl:

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

When the user drags an item and hovers over your item in Class View, the environment calls QueryDragDrop to see if a drag-drop operation is supported.

This method is very similar to the standard COM DragOver 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.

.NET Framework Security

See Also

Reference

IVsObjectList Interface

Microsoft.VisualStudio.Shell.Interop Namespace