Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

IDropTargetHelper (Interfaces)
 
.
Summary

C# Definition:

...

    using drawing = System.Drawing;
    using IDataObject_Com = System.Runtime.InteropServices.ComTypes.IDataObject;

...

    [ComVisible(true), ComImport, Guid("4657278B-411B-11D2-839A-00C04FD918D0"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface IDropTargetHelper {
    void DragEnter([In] IntPtr hwndTarget, [In, MarshalAs(UnmanagedType.Interface)] IDataObject_Com dataObject, [In] ref drawing.Point pt, [In] DragDropEffects effect);
    void DragLeave();
    void DragOver([In] ref drawing.Point pt, [In] DragDropEffects effect);
    void Drop([In, MarshalAs(UnmanagedType.Interface)] IDataObject_Com dataObject, [In] ref drawing.Point pt, [In] DragDropEffects effect);
    void Show([In] bool show);
    }

User-Defined Types:

None.

Notes:

Sample usage (in WPF):

    IDropTargetHelper dropHelper = Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("4657278A-411B-11D2-839A-00C04FD918D0"))) as IDropTargetHelper;

    protected override void OnDragEnter(DragEventArgs e) {
    ...
        var pointWpf = e.GetPosition(this);
        var point = new drawing.Point(Convert.ToInt32(pointWpf.X), Convert.ToInt32(pointWpf.Y));
        dropHelper.DragEnter(hWnd, e.Data as IDataObject_Com, ref point, e.Effects);
    ...
    }

    protected override void OnDragLeave(DragEventArgs e) {
    ...
        dropHelper.DragLeave();
    ...
    }

    protected override void OnDragOver(DragEventArgs e) {
    ...
        dropHelper.DragOver(ref point, e.Effects);
    ...
    }

    protected override void OnDrop(DragEventArgs e) {
    ...
        var pointWpf = e.GetPosition(this);
        var point = new drawing.Point(Convert.ToInt32(pointWpf.X), Convert.ToInt32(pointWpf.Y));
        dropHelper.Drop(e.Data as IDataObject_Com, ref point, e.Effects);
    ...    
    }

Documentation

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions