Пример #1
0
 public static void RightUp()
 {
     PONITAPI location = new PONITAPI();
     GetCursorPos(ref location);
     mouse_event(MOUSEEVENTF_RIGHTUP, location.x, location.y, 0, 0);
 }
Пример #2
0
 public static void LeftDown()
 {
     PONITAPI location = new PONITAPI();
     GetCursorPos(ref location);
     mouse_event(MOUSEEVENTF_LEFTDOWN, location.x, location.y, 0, 0);
 }
Пример #3
0
 /// <summary>
 /// 移动鼠标
 /// </summary>
 /// <param name="xDisplacement">横向移动距离(右正左负)</param>
 /// <param name="yDisplacement">纵向移动距离(下正上负)</param>
 public static void MoveCursor(int xDisplacement, int yDisplacement)
 {
     PONITAPI location = new PONITAPI();
     GetCursorPos(ref location);
     SetCursorPos(location.x + xDisplacement, location.y + yDisplacement);
 }
Пример #4
0
 /// <summary>
 /// 左键单击
 /// </summary>
 public static void LeftClick()
 {
     PONITAPI location = new PONITAPI();
     GetCursorPos(ref location);
     mouse_event(MOUSEEVENTF_LEFTDOWN, location.x, location.y, 0, 0);
     Thread.Sleep(100);
     mouse_event(MOUSEEVENTF_LEFTUP, location.x, location.y, 0, 0);
 }
Пример #5
0
 public static extern int GetCursorPos(ref PONITAPI p);
Пример #6
0
 private static extern int GetCursorPos(ref PONITAPI p);
Пример #7
0
 private static extern int GetCursorPos(ref PONITAPI p);
Пример #8
0
Файл: Form1.cs Проект: zinkey/AT
 private void timer1_Tick(object sender, EventArgs e)
 {
     PONITAPI pos = new PONITAPI();
     GetCursorPos(ref pos);
     label2.Text = pos.y+" "+pos.x;
 }