文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>C# 利用API操作鼠标 -- MouseAPI

C# 利用API操作鼠标 -- MouseAPI

时间:2011-04-21  来源:誓言的爱

    public class MouseAPI
{
[DllImport(
"user32.dll")]
static extern bool SetCursorPos(int X, int Y);
[DllImport(
"user32.dll")]
static extern void Mouse_event(MouseEventFlag flags, int dx, int dy, uint data, UIntPtr extraInfo);
[Flags]
public enum MouseEventFlag : uint
{
Move
= 0x0001,
LeftDown
= 0x0002,
LeftUp
= 0x0004,
RightDown
= 0x0008,
RightUp
= 0x0010,
MiddleDown
= 0x0020,
MiddleUp
= 0x0040,
XDown
= 0x0080,
XUp
= 0x0100,
Wheel
= 0x0800,
VirtualDesk
= 0x4000,
Absolute
= 0x8000
}
public void SetCursorPosition(int x, int y)
{
SetCursorPos(x, y);
}
public void MouseEvent(MouseEventFlag flag)
{
Mouse_event(flag,
0, 0, (uint)0, (UIntPtr)0);
}
}
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载