public static HRESULT DoDragDrop( IDataObject pDataObj, IDropSource pDropSource, DROPEFFECT dwOKEffects, out DROPEFFECT pdwEffect) { var result = WinFormsComWrappers.Instance.TryGetComPointer(pDataObj, IID.IDataObject, out var dataObjectPtr); if (result.Failed()) { pdwEffect = DROPEFFECT.NONE; return(result); } result = WinFormsComWrappers.Instance.TryGetComPointer(pDropSource, IID.IDropSource, out var dropSourcePtr); if (result.Failed()) { Marshal.Release(dataObjectPtr); pdwEffect = DROPEFFECT.NONE; return(result); } result = DoDragDrop(dataObjectPtr, dropSourcePtr, dwOKEffects, out pdwEffect); return(result); }
internal static IntPtr GetUnmanaged(IntPtr Window) { IDropSource drop_source; IntPtr drop_source_ptr; long offset; drop_source = new IDropSource(); drop_source.QueryInterface = Win32DnD.DSQueryInterface; drop_source.AddRef = Win32DnD.DSAddRef; drop_source.Release = Win32DnD.DSRelease; drop_source.QueryContinueDrag = Win32DnD.QueryContinueDrag; drop_source.GiveFeedback = Win32DnD.GiveFeedback; drop_source.Window = Window; drop_source_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(drop_source)); Marshal.StructureToPtr(drop_source, drop_source_ptr, false); // Update vtbl pointer offset = drop_source_ptr.ToInt64(); offset += 2 * Marshal.SizeOf(typeof(IntPtr)); Marshal.WriteIntPtr(drop_source_ptr, new IntPtr(offset)); return(drop_source_ptr); }
public static extern int DoDragDrop(ComTypes.IDataObject pDataObject, IDropSource pDropSource, DragDropEffects dwOKEffect, out DragDropEffects pdwEffect);
public uint doDragDrop(WebView sender, IDataObject dataObject, IDropSource dropSource, uint okEffect) { return 1; }
/// <include file='doc\Hierarchy.uex' path='docs/doc[@for="HierarchyNode.GetDropInfo"]/*' /> public virtual int GetDropInfo(out uint pdwOKEffects, out Microsoft.VisualStudio.OLE.Interop.IDataObject ppDataObject, out IDropSource ppDropSource){ pdwOKEffects = (uint)DropEffect.None; ppDataObject = null; ppDropSource = null; dragSource = true; if (this.hierarchyId != VsConstants.VSITEMID_ROOT){ // todo - ask project if given type of object is acceptable. pdwOKEffects = (uint)(DropEffect.Move | DropEffect.Copy); ppDataObject = PackageSelectionDataObject(false); } return 0; }
internal static IntPtr GetUnmanaged(IntPtr Window) { IDropSource drop_source; IntPtr drop_source_ptr; long offset; drop_source = new IDropSource(); drop_source.QueryInterface = Win32DnD.DSQueryInterface; drop_source.AddRef = Win32DnD.DSAddRef; drop_source.Release = Win32DnD.DSRelease; drop_source.QueryContinueDrag = Win32DnD.QueryContinueDrag; drop_source.GiveFeedback = Win32DnD.GiveFeedback; drop_source.Window = Window; drop_source_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(drop_source)); Marshal.StructureToPtr(drop_source, drop_source_ptr, false); // Update vtbl pointer offset = drop_source_ptr.ToInt64(); offset += 2 * Marshal.SizeOf(typeof(IntPtr)); Marshal.WriteIntPtr(drop_source_ptr, new IntPtr(offset)); return drop_source_ptr; }
private IntPtr DoDragDrop_Hook(IDataObject pDataObj, IDropSource pDropSource, uint dwOKEffects, uint[] pdwEffect) { _server.ReportMessage(RemoteHooking.GetCurrentProcessId(), "[INFO] Drag intercepted"); return(DoDragDrop(pDataObj, pDropSource, dwOKEffects, pdwEffect)); }
/// <summary> /// Returns information about one or more of the items being dragged /// </summary> /// <param name="pdwOKEffects">Pointer to a DWORD value describing the effects displayed while the item is being dragged, /// such as cursor icons that change during the drag-and-drop operation. /// For example, if the item is dragged over an invalid target point /// (such as the item's original location), the cursor icon changes to a circle with a line through it. /// Similarly, if the item is dragged over a valid target point, the cursor icon changes to a file or folder.</param> /// <param name="ppDataObject">Pointer to the IDataObject interface on the item being dragged. /// This data object contains the data being transferred in the drag-and-drop operation. /// If the drop occurs, then this data object (item) is incorporated into the target hierarchy or hierarchy window.</param> /// <param name="ppDropSource">Pointer to the IDropSource interface of the item being dragged.</param> /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns> public override int GetDropInfo(out uint pdwOKEffects, out IOleDataObject ppDataObject, out IDropSource ppDropSource) { //init out params pdwOKEffects = (uint)DropEffect.None; ppDataObject = null; ppDropSource = null; IOleDataObject dataObject = PackageSelectionDataObject(false); if (dataObject == null) { return(VSConstants.E_NOTIMPL); } this.SourceDraggedOrCutOrCopied = true; pdwOKEffects = (uint)(DropEffect.Move | DropEffect.Copy); ppDataObject = dataObject; return(VSConstants.S_OK); }
public static extern void DoDragDrop(IDataObject dataObject, IDropSource dropSource, int allowedEffects, int[] finalEffect);
public uint doDragDrop(WebView sender, IDataObject dataObject, IDropSource dropSource, uint okEffect) { return(1); }
public static void DoDragDrop(IDataObject dataObject, IDropSource dropSource, int allowedEffects, int[] finalEffect) { NotImplemented(MethodBase.GetCurrentMethod()); }
public static extern int DoDragDrop( IntPtr pDataObject, [MarshalAs(UnmanagedType.Interface)] IDropSource pDropSource, DragDropEffects dwOKEffect, out DragDropEffects pdwEffect);
public static extern HRESULT DoDragDrop( IDataObject pDataObj, IDropSource pDropSource, DROPEFFECT dwOKEffects, out DROPEFFECT pdwEffect);
public static extern int DoDragDrop( IOleDataObject pDataObject, // Pointer to the data object IDropSource pDropSource, // Pointer to the source DROPEFFECT dwOKEffect, // Effects allowed by the source ref DROPEFFECT pdwEffect // Pointer to effects on the source );
/// <include file='doc\Hierarchy.uex' path='docs/doc[@for="HierarchyNode.GetDropInfo"]/*' /> public virtual int GetDropInfo(out uint pdwOKEffects, out Microsoft.VisualStudio.OLE.Interop.IDataObject ppDataObject, out IDropSource ppDropSource) { pdwOKEffects = (uint)DropEffect.None; ppDataObject = null; ppDropSource = null; dragSource = true; // todo - ask project if given type of object is acceptable. pdwOKEffects = (uint)(DropEffect.Move | DropEffect.Copy); ppDataObject = PackageSelectionDataObject(false); return NativeMethods.S_OK; }
public static extern void DoDragDrop(System.Runtime.InteropServices.ComTypes.IDataObject dataObject, IDropSource dropSource, int allowedEffects, int[] finalEffect);
static extern IntPtr DoDragDrop(IDataObject pDataObj, IDropSource pDropSource, uint dwOKEffects, uint[] pdwEffect);
/// <summary> /// Returns information about one or more of the items being dragged /// </summary> /// <param name="effects">Pointer to a DWORD value describing the effects displayed while the item is being dragged, /// such as cursor icons that change during the drag-and-drop operation. /// For example, if the item is dragged over an invalid target point /// (such as the item's original location), the cursor icon changes to a circle with a line through it. /// Similarly, if the item is dragged over a valid target point, the cursor icon changes to a file or folder.</param> /// <param name="dataObject">Pointer to the IDataObject interface on the item being dragged. /// This data object contains the data being transferred in the drag-and-drop operation. /// If the drop occurs, then this data object (item) is incorporated into the target hierarchy or hierarchy window.</param> /// <param name="dropSource">Pointer to the IDropSource interface of the item being dragged.</param> /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns> public override int GetDropInfo(out DropEffects effects, out IOleDataObject dataObject, out IDropSource dropSource) { //init out params effects = (uint)DropEffects.None; dataObject = null; dropSource = null; IOleDataObject selectionDataObject = PackageSelectionDataObject(false); if(selectionDataObject == null) { return VSConstants.E_NOTIMPL; } this.SourceDraggedOrCutOrCopied = true; effects = DropEffects.Move | DropEffects.Copy; dataObject = selectionDataObject; return VSConstants.S_OK; }
/// <summary> /// Returns information about one or more of the items being dragged /// </summary> /// <param name="pdwOKEffects">Pointer to a DWORD value describing the effects displayed while the item is being dragged, /// such as cursor icons that change during the drag-and-drop operation. /// For example, if the item is dragged over an invalid target point /// (such as the item's original location), the cursor icon changes to a circle with a line through it. /// Similarly, if the item is dragged over a valid target point, the cursor icon changes to a file or folder.</param> /// <param name="ppDataObject">Pointer to the IDataObject interface on the item being dragged. /// This data object contains the data being transferred in the drag-and-drop operation. /// If the drop occurs, then this data object (item) is incorporated into the target hierarchy or hierarchy window.</param> /// <param name="ppDropSource">Pointer to the IDropSource interface of the item being dragged.</param> /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns> public override int GetDropInfo(out uint pdwOKEffects, out IOleDataObject ppDataObject, out IDropSource ppDropSource) { //init out params pdwOKEffects = (uint)DropEffect.None; ppDataObject = null; ppDropSource = null; IOleDataObject dataObject = PackageSelectionDataObject(false); if (dataObject == null) { return VSConstants.E_NOTIMPL; } this.SourceDraggedOrCutOrCopied = true; this.SourceDragged = true; pdwOKEffects = (uint)(DropEffect.Move | DropEffect.Copy); ppDataObject = dataObject; return VSConstants.S_OK; }