Arama butonu
Bu konudaki kullanıcılar: 1 misafir
2
Cevap
8623
Tıklama
0
Öne Çıkarma
C# mouse click yaptırtma
G
14 yıl
Yüzbaşı
Konu Sahibi

beyler amacım c# form üzerinde olan butona tıklangından mouse un 10 kere ard arda click yapmasını saglamak.
kodu bulamadım bitürlü yardımlarınızı bekliyorum

DH forumlarında vakit geçirmekten keyif alıyor gibisin ancak giriş yapmadığını görüyoruz.

Üye olduğunda özel mesaj gönderebilir, beğendiğin konuları favorilerine ekleyip takibe alabilir ve daha önce gezdiğin konulara hızlıca erişebilirsin.

Üye Ol Şimdi Değil



G
14 yıl
Yüzbaşı
Konu Sahibi

kodu aradım taradım buldum belki işinize yarar paylaşıyorum burdan
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace WindowsFormsApplication2
{
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);
}

}
}
}


Bu mesaja 1 cevap geldi.
_
12 yıl
Yarbay

quote:

Orijinalden alıntı: g.bale

kodu aradım taradım buldum belki işinize yarar paylaşıyorum burdan
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace WindowsFormsApplication2
{
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);
}

}
}
}

cok tesekkur ederim



DH Mobil uygulaması ile devam edin. Mobil tarayıcınız ile mümkün olanların yanı sıra, birçok yeni ve faydalı özelliğe erişin. Gizle ve güncelleme çıkana kadar tekrar gösterme.