Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. making the mouse perform a Drag-Drop with api

making the mouse perform a Drag-Drop with api

Scheduled Pinned Locked Moved C#
jsonhelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jtmtv18
    wrote on last edited by
    #1

    Im trying to get the mouse to perform a drag and drop using only the api. I can get the mouse to move around and perform clicks for me but the challenge is the drag and drop operation. im trying to store the previous state of the mouse (*ie when it was pressed down*) and then while the previous state==mousedown start dragging and holding it down, until i get a left mouse up message. but i cant get it to work correctly. here is the code im using Input[] input = new Input[ 1 ]; input[0].type = INPUT.MOUSE; input[0].mi.dx = x2; input[0].mi.dy = y2; //input[0].mi.dwFlags = MOUSEEVENTF.MOVE| MOUSEEVENTF.ABSOLUTE ; if(prev.wParam==UserActivityHook.WM_LBUTTONDOWN) { input[0].mi.dwFlags =MOUSEEVENTF.LEFTDOWN| MOUSEEVENTF.ABSOLUTE; SendInput( ( UInt32 ) input.Length, input, Marshal.SizeOf( input[ 0 ]) ); Console.WriteLine("test"); } input[0].mi.dwFlags = MOUSEEVENTF.MOVE| MOUSEEVENTF.ABSOLUTE ; SendInput( ( UInt32 ) input.Length, input, Marshal.SizeOf( input[ 0 ] ) ); Any ideas? i have been looking around online and will continue to. Thanks alot for your help

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups