namespace Projeismi{
public partial class MainWindow : Window {
private const UInt32 MOUSEEVENTF_LEFTDOWN = 0x0002;
private const UInt32 MOUSEEVENTF_LEFTUP = 0x0004;
[DllImport("user32.dll")] private static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint dwData, uint dwExtraInf);
[DllImport("user32.dll")] private static extern bool SetCursorPos(int x, int y);
public MainWindow() { InitializeComponent(); }
private void OnButtonSearchPixelClick(object sender, RoutedEventArgs e) { // Burası buton tıklandığı zaman
DoubleClickAtPosition(617, 343);
}
private void DoubleClickAtPosition(int posX, int posY) {
SetCursorPos(posX, posY);
Click();
}
private void Click() {
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); }
}//class son } // namespace son C# Mause Click
2
●60
- 23-11-2020, 21:10:19Merhabalar,aşağıdaki kod ile sorunsuz tıklama yapabiliyorum fakat imlecin tıklamaya uygun olmadığı yerlere nedense tıklamıyor.koordinata başka nasıl tıklama yapabilirim?
