Quiero que al poner el cursor encima del boton "NO" se mueva aleatoriamente,se sobre programación, pero solo en c++ y python, espero me puedan ayudar.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.Remoting.Channels;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace NICOL
{
public partial class Nicolapp : Form
{
public Nicolapp()
{
InitializeComponent();
}
private static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
const int MOUSEEVENTF_MOVE = 0x0001;
//Simulate left mouse button press
const int MOUSEEVENTF_LEFTDOWN = 0x0002;
//Simulate left mouse button up
const int MOUSEEVENTF_LEFTUP = 0x0004;
//Simulate mouse right click
const int MOUSEEVENTF_RIGHTDOWN = 0x0008;
//Simulate the right mouse button up
const int MOUSEEVENTF_RIGHTUP = 0x0010;
//Analog mouse button press
const int MOUSEEVENTF_MIDDLEDOWN = 0x0020;
//Analog mouse middle button lift
const int MOUSEEVENTF_MIDDLEUP = 0x0040;
//Indicate whether absolute coordinates are used
const int MOUSEEVENTF_ABSOLUTE = 0x8000;
private void Form1_Load(object sender, EventArgs e)
{
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("Ya sabia que dirias que Si uwu :v");
}
private void NO_Click(object sender, EventArgs e)
{
Thread.Sleep(1500);//1.5 Segundos para mover el mouse, aqui me da error
SetCursorPos(1414, 117);//Posicion a donde vas a enviar tu texto o pulsaciones y me da error
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
SendKeys.Send("^v");//Aqui un ejemplo de pegar un texto
}
public event System.Windows.Forms.MouseEventHandler MouseMove;
}
}
Si pueden me envían el código para copiarlo directamente, muchas gracias por darse el tiempo de leerlo :)