Şimdi Ara

C# mouse click yaptırtma

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
3 Misafir - 3 Masaüstü
5 sn
3
Cevap
0
Favori
8.623
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • 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



  • 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);
    }

    }
    }
    }




  • 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




  • Yapay Zeka’dan İlgili Konular
    VMware Keyboard ve Mouse Sorunu
    16 yıl önce açıldı
    Daha Fazla Göster
    
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.