private void Btn_start_Click(object sender, RoutedEventArgs e) { if (threadloop == false) { wPoint mouse_pos = new wPoint( Convert.ToInt32(txt_mouse_click_posX.Text), Convert.ToInt32(txt_mouse_click_posY.Text)); wPoint lefttop = new wPoint(Convert.ToInt32(screen_lefttop_x.Text), Convert.ToInt32(screen_lefttop_y.Text)); wPoint rightbottom = new wPoint(Convert.ToInt32(screen_rightbottom_x.Text), Convert.ToInt32(screen_rightbottom_y.Text)); mac = new Macro_AutoClick(mouse_pos, lefttop, rightbottom); mac.IsScreenShotEnabled = Convert.ToBoolean(isScreenShot.IsChecked); mac.StartThread(); threadloop = true; } else { mac.EndThread(); threadloop = false; } return; }
private void MousePosCallBack(object sender, EventArgs e) { Point pointToWindow = Macro_AutoClick.GetMousePosition(); txt_mouse_pos.Text = pointToWindow.X.ToString() + ", " + pointToWindow.Y.ToString(); }