ahmet_kıran
Hectopat
C# da buton açtım ve v tuşuna basınca 3 tuşuna basıp sağ mouse tuşuna basıp 1'e basmasını istiyorum nasıl yapacağım?
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern void mouse_event(int dwFlags, int dX, int dY, int cButtons, int dwExtraInfo);
public const int MOUSEEVENTF_RIGHTDOWN = 0x08;
public const int MOUSEEVENTF_RIGHTUP = 0x10;
public static void rightClick()
{
int xPos = Cursor.Position.X;
int yPos = Cursor.Position.Y;
mouse_event(MOUSEEVENTF_RIGHTDOWN, xPos, yPos, 0, 0);
mouse_event(MOUSEEVENTF_RIGHTUP, xPos, yPos, 0, 0);
}
private void button1_Click(object sender, EventArgs e)
{
SendKeys.Send("(3)");
rightClick();
SendKeys.Send("(1)");
}
}
Öyle bir şey ki yaparken sağımı solumu karıştırdım
C#:public partial class Form1 : Form. { public Form1() { InitializeComponent(); } [System.Runtime.InteropServices.DllImport("user32.dll")] public static extern void mouse_event(int dwFlags, int dX, int dY, int cButtons, int dwExtraInfo); public const int MOUSEEVENTF_RIGHTDOWN = 0x08; public const int MOUSEEVENTF_RIGHTUP = 0x10; public static void rightClick() { int xPos = Cursor.Position.X; int yPos = Cursor.Position.Y; mouse_event(MOUSEEVENTF_RIGHTDOWN, xPos, yPos, 0, 0); mouse_event(MOUSEEVENTF_RIGHTUP, xPos, yPos, 0, 0); } private void button1_Click(object sender, EventArgs e) { SendKeys.Send("(3)"); rightClick(); SendKeys.Send("(1)"); } }
Ooh Minecraft olta, pot makrosu yapmaca.
Önem Derecesi Kod Açıklama Proje Dosya Çizgi Gizleme DurumuÖyle bir şey ki yaparken sağımı solumu karıştırdım
C#:public partial class Form1 : Form { public Form1() { InitializeComponent(); } [System.Runtime.InteropServices.DllImport("user32.dll")] public static extern void mouse_event(int dwFlags, int dX, int dY, int cButtons, int dwExtraInfo); public const int MOUSEEVENTF_RIGHTDOWN = 0x08; public const int MOUSEEVENTF_RIGHTUP = 0x10; public static void rightClick() { int xPos = Cursor.Position.X; int yPos = Cursor.Position.Y; mouse_event(MOUSEEVENTF_RIGHTDOWN, xPos, yPos, 0, 0); mouse_event(MOUSEEVENTF_RIGHTUP, xPos, yPos, 0, 0); } private void button1_Click(object sender, EventArgs e) { SendKeys.Send("(3)"); rightClick(); SendKeys.Send("(1)"); } }
Sınıfın adıyla fonksiyonun adının aynı olamayacağını belirtiyor.
Derleyicini İngilizce kullanmanı öneririm. Hata kodu olmasa ne olduğunu anlamayacaktım.
Kodunu paylaşır mısın?Ne yapacağım şimdi hatayı düzeltmek için?
Kodunu paylaşır mısın?
Bu sitenin çalışmasını sağlamak için gerekli çerezleri ve deneyiminizi iyileştirmek için isteğe bağlı çerezleri kullanıyoruz.