none
Perform Drag-And-Drop programmatically

    Question

  • Anybody knows how to perform drag-and-drop operation programmatically (without mouse moving etc)?
    For example i want drag some file to opened notepad.

    may be i should use something like this:
    using System.Runtime.InteropServices;
    
    [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
    static extern IntPtr SendMessage(IntPtr hWnd, Int32 Msg, IntPtr wParam, IntPtr lParam);
    
    System.Diagnostics.Process[] p = System.Diagnostics.Process.GetProcessesByName("notepad");
    SendMessage(p[0].MainWindowHandle, /*Msg, wParam, lParam*/);
    but i don't know any winAPI drag-and-drop message. Any suggestions?
    Thanks
    Tuesday, June 16, 2009 10:32 AM

Answers

All replies