Hallo Leute.
Für ein Programm, welches den geregelten Ablauf während meiner Abwesenheit regeln soll, brauche ich eine MouseClick simulation.
Im Manual steht darüber folgendes:
Zitat: |
The best way to simulate mouse events is to call the OnEventName method that raises the mouse event you want to simulate. This option is usually possible only within custom controls and forms, because the methods that raise events are protected and cannot be accessed outside the control or form. For example, the following steps illustrate how to simulate clicking the right mouse button in code.
To programmatically click the right mouse button
Create a MouseEventArgs whose Button property is set to the MouseButtons.Right value.
Call the OnMouseClick method with this MouseEventArgs as the argument.
|
In meinem beispiel-Programm hab ich es so gecodet:
C#-Quelltext
1: 2:
| MouseEventArgs mymouseeventarg = new MouseEventArgs(MouseButtons.Right, 1, 100,120, 0); OnMouseClick(mymouseeventarg); |
Parameter 1 : welcher mousebutton gedrückt wurde
Parameter 2 : Anzahl Clicks
Parameter 3 : X-Koordinaten
Parameter 4 : Y-koordinaten
Parameter 5 : delta?? "A signed Count of the number of detents the whell has rotated
1. was bewirkt der Parameter delta?
2. wie muss ich das umschreiben, damit es funktioniert?
mfg
mr tobo
Moderiert von
Christian S.: Topic aus C# - Die Sprache verschoben am So 14.12.2008 um 13:47