using System;
using System.Runtime.InteropServices;
namespace ab
{
class ab
{
[DllImport("user32.dll")]
public static extern void mouse_event(long dwFlags,long dx,long dy ,long dwData ,long dwExtralnfo);
public const long MOUSEEVENTF_LEFTDOWN = 0x2;
public const long MOUSEEVENTF_LEFTUP = 0x4;
public const long MOUSEEVENTF_MIDDLEDOWN = 0x20;
public const long MOUSEEVENTF_MIDDLEUP = 0x40;
public const long MOUSEEVENTF_MOVE = 0x1;
public const long MOUSEEVENTF_ABSOLUTE = 0x8000;
public const long MOUSEEVENTF_RIGHTDOWN = 0x8;
public const long MOUSEEVENTF_RIGHTUP = 0x10;
public static void Main()
{
mouse_event(MOUSEEVENTF_ABSOLUTE|MOUSEEVENTF_MOVE,10000,10000,0,0);
}
}
}
这段代码是模拟鼠标的绝对位置移动但是我执行的时候鼠标只上下移动不左右移动而且总在屏幕最旁边移动
我晕了大家能帮看下是那里的问题吗我实在是郁闷
模拟鼠标