private void ExecuteYoutube() { Process.Start(@"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"); Thread.Sleep(1000); var r = new Random(); @"https://music.youtube.com/watch?v=zX4rQyvBR70".ToList().ForEach((x) => { Send($"{x}"); Thread.Sleep(40 + r.Next(3) * 30); if (r.Next(13) < 1) { Thread.Sleep(400); } }); Send("{enter}"); Thread.Sleep(1000); Activate(); VirtualWindow.SetValue(Canvas.LeftProperty, (double)(Screen.PrimaryScreen.Bounds.Width / 2 - 640)); VirtualWindow.SetValue(Canvas.TopProperty, (double)(Screen.PrimaryScreen.Bounds.Height / 2 - 375)); }
private void MouseCaptureTimer_Tick(object sender, EventArgs e) { if (!IsDragging) { return; } double X = 0; double Y = 0; X = MouseGetPos().X - ClickedPosition.X; Y = MouseGetPos().Y - ClickedPosition.Y; VirtualWindow.SetValue(Canvas.LeftProperty, X); VirtualWindow.SetValue(Canvas.TopProperty, Y); OverlayVirtualWindow.SetValue(Canvas.LeftProperty, X); OverlayVirtualWindow.SetValue(Canvas.TopProperty, Y + 30); Debug.WriteLine(Mouse.GetPosition(null)); if (Mouse.LeftButton == MouseButtonState.Released) { Rectangle_MouseLeftButtonUp(null, null); } }