public static async Task ShowOpenFileMenu() { var points = await GetOpenFileHelper(); var hwnd = WinApi.FindWindow(null, "Mathematical modeling"); var rct = new WinApi.RECT(); WinApi.GetWindowRect(hwnd, ref rct); var leftDisposition = CalculatedRect.Left - rct.Left; var topDisposition = CalculatedRect.Top - rct.Top; foreach (var point in points) { var currPoint = point; await Task.Run(() => WinApi.SetCursorPos(leftDisposition + currPoint.X, topDisposition + currPoint.Y)); Thread.Sleep((int)currPoint.Delay); } }
public static async Task ShowInputFlyout() { var points = await GetFlyoutHelper(); var hwnd = WinApi.FindWindow(null, "Mathematical modeling"); var rct = new WinApi.RECT(); WinApi.GetWindowRect(hwnd, ref rct); var leftDisposition = CalculatedRect.Left - rct.Left; var topDisposition = CalculatedRect.Top - rct.Top; foreach (var point in points) { var currPoint = point; await Task.Run(() => WinApi.SetCursorPos(leftDisposition + currPoint.X, topDisposition + currPoint.Y)); Thread.Sleep((int)currPoint.Delay); } var lastPoint = points.Last(); WinApi.ClickRightMouseButton(lastPoint.X, lastPoint.Y); }