IVsObjectList2.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.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)


Function QueryDragDrop ( _
    index As UInteger, _
    pDataObject As IDataObject, _
    grfKeyState As UInteger, _
    <OutAttribute> ByRef pdwEffect As UInteger _
) As Integer
‘사용 방법
Dim instance As IVsObjectList2
Dim index As UInteger
Dim pDataObject As IDataObject
Dim grfKeyState As UInteger
Dim pdwEffect As UInteger
Dim returnValue As Integer

returnValue = instance.QueryDragDrop(index, _
    pDataObject, grfKeyState, pdwEffect)
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


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


COM Signature

From vsshell80.idl:

HRESULT IVsObjectList2::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


IVsObjectList2 Interface

IVsObjectList2 Members

Microsoft.VisualStudio.Shell.Interop Namespace