using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private readonly int MOUSEEVENTF_LEFTDOWN = 0x2;
private readonly int MOUSEEVENTF_LEFTUP = 0x4;
private readonly int MOUSEEVENTF_RIGHTDOWN = 0x008;
private readonly int MOUSEEVENTF_RIGHTUP = 0x0010;
public Form1()
{
InitializeComponent();
}
private void submit_Click(object sender, EventArgs e)
{
if (this.textBox1.Text == "")
{
// this.textBox1.Focus();
SendKeys.Send("1");
int X,Y;
X = 80;
Y = 80;
SetCursorPos(X, Y);
mouse_event(MOUSEEVENTF_LEFTDOWN, X, Y, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
SendKeys.Send("3808902");
// X = 80;
// Y = 230;
// SetCursorPos(X, Y);
// mouse_event(MOUSEEVENTF_LEFTDOWN, X, Y, 0, 0);
// mouse_event(MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
}
}
[DllImport("user32.dll", EntryPoint = "SetCursorPos")]
private static extern int SetCursorPos(int x, int y);
[DllImport("user32.dll", EntryPoint="mouse_event")]
public static extern void mouse_event (int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private readonly int MOUSEEVENTF_LEFTDOWN = 0x2;
private readonly int MOUSEEVENTF_LEFTUP = 0x4;
private readonly int MOUSEEVENTF_RIGHTDOWN = 0x008;
private readonly int MOUSEEVENTF_RIGHTUP = 0x0010;
public Form1()
{
InitializeComponent();
}
private void submit_Click(object sender, EventArgs e)
{
if (this.textBox1.Text == "")
{
// this.textBox1.Focus();
SendKeys.Send("1");
int X,Y;
X = 80;
Y = 80;
SetCursorPos(X, Y);
mouse_event(MOUSEEVENTF_LEFTDOWN, X, Y, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
SendKeys.Send("3808902");
// X = 80;
// Y = 230;
// SetCursorPos(X, Y);
// mouse_event(MOUSEEVENTF_LEFTDOWN, X, Y, 0, 0);
// mouse_event(MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
}
}
[DllImport("user32.dll", EntryPoint = "SetCursorPos")]
private static extern int SetCursorPos(int x, int y);
[DllImport("user32.dll", EntryPoint="mouse_event")]
public static extern void mouse_event (int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
}
}