日期:2014-05-17 浏览次数:20999 次
uint MOUSEEVENTF_MOVE = 0x0001;
uint MOUSEEVENTF_LEFTDOWN = 0x0002;
uint MOUSEEVENTF_LEFTUP = 0x0003;
[DllImport("user32.dll")]
private static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint dwData, uint dwExtraInfo);
private void button1_Click(object sender, EventArgs e)
{
mouse_event(MOUSEEVENTF_LEFTDOWN, 370, 400, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 370, 400, 0, 0);
//为什么我上面这样,实现不了鼠标的单击?反倒搞得我的鼠标不见了
}