[DllImport(User)] public extern static void mouse_event(int dwFlags int dx int dy int dwData IntPtr dwExtraInfo)[DllImport(userdll)] static extern bool SetCursorPos(int X int Y)
public enum MouseEventFlags { Move = xLeftDown = xLeftUp = xRightDown = xRightUp = xMiddleDown = xMiddleUp = xWheel = xAbsolute = x } private void button_Click(object sender EventArgs e)
{ SetCursorPos( )//用屏幕取点工具可以得到坐标mouse_event((int)(MouseEventFlagsLeftDown | MouseEventFlagsAbsolute) IntPtrZero)mouse_event((int)(MouseEventFlagsLeftUp | MouseEventFlagsAbsolute) IntPtrZero)}