C# mouse click algılama (yardım gerek)

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Banlı Üye
Katılım
26 Nis 2016
Mesajlar
933
Çözümler
2
Tepki puanı
228
Ödüller
6
10 HİZMET YILI
form arka plandayken mouse clicklerini algılamasını istiyorum

bulduğum mouse hooklar çalışmıyor :/
 
CSharp
Banlı Üye
Katılım
31 Tem 2018
Mesajlar
463
Çözümler
3
Tepki puanı
149
Ödüller
3
7 HİZMET YILI
GetAsyncKeyState'i Import et programa ordan basılan tuş LButton ise işlemi gerçekleştirmesini sağla

Kod:
[DllImport("user32.dll")]
private static extern short GetAsyncKeyState(System.Windows.Forms.Keys vKey);

// O Tuşa Tıkladığında true döner.
public static bool IsPressed(System.Windows.Forms.Keys Key)
{
    return (GetAsynKeyState(Key) != 0) ? true : false;
}

// O Tuşa Basılı ise true döner.
public static bool IsHolding(System.Windows.Forms.Keys Key)
{
    return ((GetAsyncKeyState(Key) & 0x8000) > 0) ? true : false;
}
 
Son düzenleme:
  • Konuyu başlatan
  • Yasaklandı
  • #3
Banlı Üye
Katılım
26 Nis 2016
Mesajlar
933
Çözümler
2
Tepki puanı
228
Ödüller
6
10 HİZMET YILI
GetAsyncKeyState'i Import et programa ordan basılan tuş LButton ise işlemi gerçekleştirmesini sağla

Kod:
[DllImport("user32.dll")]
private static extern short GetAsyncKeyState(System.Windows.Forms.Keys vKey);

// O Tuşa Tıkladığında true döner.
public static bool IsPressed(System.Windows.Forms.Keys Key)
{
    return (GetAsynKeyState != 0) ? true : false;
}

// O Tuşa Basılı ise true döner.
public static bool IsHolding(System.Windows.Forms.Keys Key)
{
    return ((GetAsyncKeyState(Key) & 0x8000) > 0) ? true : false;
}
Kod:
            if(IsHolding(Keys.LButton) == true)
            {
            
            }

bunu denedim ama olmuyor
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Üst