Autor Beitrag
Geneesys
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36



BeitragVerfasst: Mo 10.10.11 08:50 
Hallo alle zsm,

Ich habe schon überall gesucht aber keine klare antwort gefunden.

Ich suche für meine Consolenanwendung einen code der einfach einen rechtsklick ausübt.

Hätte jemand so einen ?

Danke im voraus.

Gruß
Geneesys


Moderiert von user profile iconTh69: Topic aus C# - Die Sprache verschoben am Mo 10.10.2011 um 10:36
Moderiert von user profile iconTh69: Titel geändert: Consolenanwendung -> Konsolenanwendung
validas
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 35

WinXP, Win7
Microsoft Visual Studio 2010
BeitragVerfasst: Mo 10.10.11 09:23 
So weit ich mich besinnen kann, bietet das Framework keine Klasse für die Maussimulation... Tastatureingaben können aber mit sendKey() gemacht werden... habe aber etwas gefunden, was dir helfen könnte... und bitte schau dir die Antworten GENAU an, denn wie schon geschrieben ist, ist es nicht der Sinn der Sache, den Client zu simulieren. Da hat der gute Herr schon recht! Falls du ein Externes Programm zu steuern beabsichtigst, solltest du deren DLLs nutzen oder mit der process() Klasse arbeiten.
www.programmiersprac...mulieren/index2.html
Dr. Hallo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110
Erhaltene Danke: 13

XP
C/C++/C#
BeitragVerfasst: Di 11.10.11 17:53 
So ein ähnlches Problem hatte ich auch schon..
so habs ichs gelöst.

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
[DllImport("user32.dll")]
static extern bool SetCursorPos(int X, int Y);  
 
[DllImport("user32.dll")]
static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint dwData,  int dwExtraInfo);
 
[Flags]
  public enum MouseEventFlags
  {
    LEFTDOWN   = 0x00000002,
    LEFTUP     = 0x00000004,
    MIDDLEDOWN = 0x00000020,
    MIDDLEUP   = 0x00000040,
    MOVE       = 0x00000001,
    ABSOLUTE   = 0x00008000,
    RIGHTDOWN  = 0x00000008,
    RIGHTUP    = 0x00000010
  }
...
//Set cursor position  
this.SetCursorPos(1050);
//Mouse Right Down and Mouse Right Up
mouse_event((uint)MouseEventFlags.RIGHTDOWN,0,0,0,0);
mouse_event((uint)MouseEventFlags.RIGHTUP,0,0,0,0);


EDIT : hier hab ich noch den der link dazu wiedergefnden
social.msdn.microsof...8f-99ac-dc273f50ace2