public Form1() { InitializeComponent(); //overlayForm.Hide(); panel2.Hide(); AutoClicker.init(); }
private void TabControl1_SelectedIndexChanged(object sender, System.EventArgs e) { if (tabControl1.SelectedIndex != 0) { AutoClicker.disableClicker(); } }
private void OverlayForm_Paint(object sender, PaintEventArgs e) { string labelString; if (AutoClicker.isActive()) { labelString = "Enabled"; } else { labelString = "Disabled"; } Graphics g = e.Graphics; g.SmoothingMode = SmoothingMode.AntiAlias; g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.PixelOffsetMode = PixelOffsetMode.HighQuality; g.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit; g.DrawString(labelString, new Font("Tahoma", 25), Brushes.Crimson, GetScreen().Width - 175, 0); }
private void button3_Click(object sender, EventArgs e) { AutoClicker.autoClickerPeriodicTimer.Stop(); int windowSelectionTimeOut = 15000; int windowGrabberClockInterval = 200; int index = 0; button3.Text = "Press Scroll Lock to Select"; Task <bool> windowGrabber = Task <bool> .Factory.StartNew(() => { int startVar = AutoClicker.GetKeyState(145); while (AutoClicker.GetKeyState(145) == startVar) { index++; Thread.Sleep(windowGrabberClockInterval); if (windowSelectionTimeOut / windowGrabberClockInterval < index) { return(false); } } AutoClicker.autoClickWindow = AutoClicker.GetForegroundWindow(); return(true); }); bool windowResult = windowGrabber.Result; if (windowResult) { label5.Text = AutoClicker.GetActiveWindow(); button3.Text = "Select a New Window"; } else { button3.Text = "Select Window"; } AutoClicker.autoClickerPeriodicTimer.Start(); }