Пример #1
0
 /// <summary>
 /// 任务点击
 /// </summary>
 /// <param name="hwnd"></param>
 /// <param name="x"></param>
 /// <param name="y"></param>
 public static void taskClick(int hwnd, int x, int y)
 {
     Global.mouseMx.WaitOne();
     //获取窗口焦点
     LoadDll.SetForegroundWindow((IntPtr)hwnd);
     //设置窗口显示状态
     LoadDll.SetWindowPos((IntPtr)hwnd, -2, 0, 0, 0, 0, 3);
     System.Threading.Thread.Sleep(1500);
     MouseMove(hwnd, x, y);
     // 写入单击事件
     LoadDll.WriteMemoryHwndValue((IntPtr)hwnd, new IntPtr(Global.addr.bX - 8).ToInt32(), BitConverter.GetBytes(1));
     System.Threading.Thread.Sleep(80);
     LoadDll.WriteMemoryHwndValue((IntPtr)hwnd, new IntPtr(Global.addr.bX - 8).ToInt32(), BitConverter.GetBytes(0));
     Global.mouseMx.ReleaseMutex();
 }