Steven Yates
Steven Yates

Reputation: 2480

Read item being dragged by mouse

I'm wondering if their is any way to see what's currently being dragged by the mouse. I don't mean over a winforms as i can handle events and get it that way but has anyone been able to invoke some of the win api to read the object or information about it?

I'm trying 'monitor' (probably not the best choice of words) the cursor and see whats being dragged and then potentially read that object.

C# / C++ idea's all welcome !

Thanks in advance

Upvotes: 3

Views: 345

Answers (1)

Ben
Ben

Reputation: 35613

One way to do this by design is to inject code into all applications, by means of a hook.

This will allow you to detect when dragging is occurring, and you can use the standard windows APIs that the application itself can use to find out what is being dragged.

A second way is to use Windows UI automation. This will not give you exactly what the application sees, or give you access to the exact data being dragged or dropped, but it may give you enough information for whatever your purposes are.

Try using UISpy or Inspect.exe to see UI Automation events.

Upvotes: 2

Related Questions