Reputation: 2842
how to implement mouse drag&drop process
example
SetCursorPos(32, 32);
mouse_event((uint)MouseEventFlags.RIGHTDOWN,0,0 ,0,0);
mouse_event((uint)MouseEventFlags.RIGHTUP,0,0 ,0,0);
SetCursorPos(38, 38);
mouse_event((uint)MouseEventFlags.LEFTDOWN,0,0 ,0,0);
mouse_event((uint)MouseEventFlags.LEFTUP,0,0 ,0,0);
this is code for open whatever in topleft of the screen how to implement the drag & drop in this particular code or anyotherways?
Upvotes: 1
Views: 1604
Reputation: 1996
You would have to look into the Drag and Drop event(s) of the form, I think you need to enable OnEnter on the form aswell, its been a while since i've done windows forms programming.
Think it is called DragEnter, you can read more on the following pages:
http://vicky4147.wordpress.com/2007/02/04/a-simple-drag-drop-in-winforms/
Other than that i'd look into uzbones answer
Upvotes: 1
Reputation: 1422
Here is Microsoft's Drag and Drop Overview
Forms .NET 1.1:
http://msdn.microsoft.com/en-us/library/ms973845.aspx
Forms .NET 2.0:
http://msdn.microsoft.com/en-us/library/za0zx9y0(VS.80).aspx
WPF:
http://msdn.microsoft.com/en-us/library/ms742859.aspx
Upvotes: 1