AccessTr.neT

Tam Versiyon: VS C# Mouse Click kodu?
Şu anda arşiv modunu görüntülemektesiniz. Tam versiyonu görüntülemek için buraya tıklayınız.
forumda 2 buton olacak
buton1_click olayına mouse sol tuş belli saniye aralıklarla tık tık basmasını
buton2_click olayına ise tıklama olayını bitirmesini istiyorum

0.5 saniye aralıklarla sonsuz döngüde sol tık yapan kodları nasıl oluşturabilirim?

teşekkürler
Hiç süre bazında click olayını denememiştim cevap gelirse öğrenmiş olacağız ama bir yerden edindiğim bir bilgi var umarım azda olsa yardımcı olur,

Mousenin 10 kere ard arda click olayı ;

public partial class Form1 : Form

{
[DllImport("user32.dll",CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)]
public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo);

private const int MOUSEEVENTF_LEFTDOWN = 0x02;
private const int MOUSEEVENTF_LEFTUP = 0x04;

public Form1()
{
DoMouseClick();
}
public void DoMouseClick()
{
for (int i = 0; i < 200; i++)
{
System.Threading.Thread.Sleep(100);
//Call the imported function with the cursor's current position
int X = Cursor.Position.X;
int Y = Cursor.Position.Y;
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
}

}
}
}

Siz arayın yaparsanız ve kodları paylaşırsanız çok iyi olur en azından diğer arkadaşlar ve bende bilgilenmiş oluruz iyi geceler...
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo);
private const int MOUSEEVENTF_LEFTDOWN = 0x02;
private const int MOUSEEVENTF_LEFTUP = 0x04;
private void Form1_Load(object sender, EventArgs e)
{

}
public static void MouseLeftClick(Point pos)
{
System.Windows.Forms.Cursor.Position = pos;
mouse_event(MOUSEEVENTF_LEFTDOWN, pos.X, pos.Y, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, pos.X, pos.Y, 0, 0);
}
private void timer1_Tick(object sender, EventArgs e)
{
MouseLeftClick(MousePosition);
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Start();
}
private void button2_Click(object sender, EventArgs e)
{
timer1.Stop();
}


ne hata veriyor ne de çalışıyor Img-grin
Çok zor ve karmaşık bir konu bende denedim ama beceremedim Img-grin