public void march(Model.Rect rect) { //model.lineUp(); //model.gather(); //model.march(destination); model.square(rect); }
public static void OnClickButton(IntPtr vpnHWnd, IntPtr BtnHWnd) { Model.Rect rect = new Model.Rect(); GetWindowRect(BtnHWnd, out rect); ShowWindow(vpnHWnd, WindowsMessageValue.SW_SHOWNORMAL); SetForegroundWindow(vpnHWnd); Thread.Sleep(100); int x = Convert.ToInt32((rect.Left + rect.Right) / 2); int y = Convert.ToInt32((rect.Top + rect.Bottom) / 2); MouseClick(x, y); }
public static extern int GetWindowRect(IntPtr hwnd, out Model.Rect lpRect);//获取窗口坐标