In fact this is two question, but those is all about mouse operate.
I want to code a small tool which can simulate mouse operates, such as drag a file to a new position.
But I don't know how to get the mouse click position, as I want to record the mouse operation. and I don't know how to simulate mouse drag. Can anyone give me some ideas. Thanks very much.
P.S. For mouse drag, I tried this method but it won't work:
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
public const int MOUSEEVENTF_LEFTDOWN = 0x2;
public const int MOUSEEVENTF_LEFTUP = 0x4;
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Cursor.Position = new System.Drawing.Point(x, y);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);