Hi ^^
Sry kann jetzt erst wieder zurück schreiben.
Ok ich stelle jetzt am besten ma den gesamten Codeausschnitt rein ...
Einmal was ich alles benutze:
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;
mausklick:
[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;
private const int MOUSEEVENTF_RIGHTDOWN = 0x08;
private const int MOUSEEVENTF_RIGHTUP = 0x10;
public void DoMouseClick()
{
//Call the imported function with the cursor's current position
int X = Cursor.Position.X;
int Y = Cursor.Position.Y;
mouse_event(MOUSEEVENTF_LEFTDOWN, X, Y, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
}
Aufruf:
private void anfangen_Click(object sender, EventArgs e)
{
Point startingPoint = panel1.Location;
startingPoint.Offset(500, 200);
Cursor.Position = PointToScreen(startingPoint);
DoMouseClick();
SendKeys.Send("{RIGHT}");
}
Ich hoffe das es kein einfacher Tippfehler ist, denn das wär bissel doof ^^
Vielen Dank für eure Hilfe!
Bin leider noch ein Anfänger in C#