日期:2014-05-17 浏览次数:20726 次
[DllImport("User32.Dll")]
public static extern long SetCursorPos(int x, int y);
[DllImport("user32.dll")]
public extern static void mouse_event(int dwFlags, int dx, int dy, int dwData, IntPtr dwExtraInfo);
private void button2_Click(object sender, EventArgs e)
{
HtmlElement kk = webBrowser3.Document.GetElementById("alloy_icon_app_50_3");
Rectangle rect = kk.OffsetRectangle;
Point p = new Point(rect.Left + 40, rect.Top + 110);
p = this.PointToScreen(p);
SetCursorPos(p.X, p.Y);
mouse_event(6, 0, 0, 0, IntPtr.Zero);
}