Hallo!
Ich habe bereits eine Visual Basic Software geschrieben. Diese Software will ich nun wie folgt erweitern:
Auf Knopfdruck soll demonstriert werden, was die Software so kann.
Das wollte ich mit AutoIT lösen.
Nun habe ich eine Visual Basic Software und einen AutoIT Script, der meine Software sozusagen "bedient".
Mein Wunsch ist: Über die AutoIT Library für Visual Studio würde ich gerne meine AutoIT Software in meine Visual Basic Software einbinden.
Doch dann habe ich das Problem, dass AutoIT meine Software bedient, meine Software aber auf die ganzen Mausklicks gar nicht reagiert.
Ich denke das liegt daran, dass ich nur einen Prozess für Visual Basic und AutoIT habe. Somit kann Visual Basic erst wieder reagieren, wenn der AutoIT Script zuende geht.
Gibt es dafür eine Abhilfe?
Wäre dankbar für Eure Hilfe.
Hier der Programmteil mit AutoIT:
Ich weiß, das ist nicht wirklich professionell, aber ich mache das eigentlich nur nebenher und nur für mich.
*Topic verschoben*
Ich habe bereits eine Visual Basic Software geschrieben. Diese Software will ich nun wie folgt erweitern:
Auf Knopfdruck soll demonstriert werden, was die Software so kann.
Das wollte ich mit AutoIT lösen.
Nun habe ich eine Visual Basic Software und einen AutoIT Script, der meine Software sozusagen "bedient".
Mein Wunsch ist: Über die AutoIT Library für Visual Studio würde ich gerne meine AutoIT Software in meine Visual Basic Software einbinden.
Doch dann habe ich das Problem, dass AutoIT meine Software bedient, meine Software aber auf die ganzen Mausklicks gar nicht reagiert.
Ich denke das liegt daran, dass ich nur einen Prozess für Visual Basic und AutoIT habe. Somit kann Visual Basic erst wieder reagieren, wenn der AutoIT Script zuende geht.
Gibt es dafür eine Abhilfe?
Wäre dankbar für Eure Hilfe.
Hier der Programmteil mit AutoIT:
VB.NET-Quellcode
- Private Sub Button21_Click(sender As Object, e As EventArgs) Handles Button21.Click
- Me.Close()
- Dim AutoIT As New AutoItX3Lib.AutoItX3
- AutoIT.AutoItSetOption("MouseCoordMode", 2)
- AutoIT.ControlFocus("Notizen", "", "[NAME:TextBoxNotiz]")
- AutoIT.Send("H")
- AutoIT.Sleep(100)
- AutoIT.Send("e")
- AutoIT.Sleep(100)
- AutoIT.Send("l")
- AutoIT.Sleep(100)
- AutoIT.Send("l")
- AutoIT.Sleep(100)
- AutoIT.Send("o")
- AutoIT.Sleep(100)
- AutoIT.Send(".")
- AutoIT.Sleep(500)
- Dim ContrPosX
- Dim ContrPosY
- ContrPosX = AutoIT.ControlGetPosX("Notizen", "Einstellungen", "[NAME:ButtonEinstellungen]")
- ContrPosY = AutoIT.ControlGetPosY("Notizen", "Einstellungen", "[NAME:ButtonEinstellungen]")
- AutoIT.MouseClick("left", ContrPosX + 61, ContrPosY + 10)
- AutoIT.Sleep(500)
- ContrPosX = AutoIT.ControlGetPosX("Einstellungen", "Rot", "[NAME:Button4]")
- ContrPosY = AutoIT.ControlGetPosY("Einstellungen", "Rot", "[NAME:Button4]")
- AutoIT.MouseClick("left", ContrPosX + 74, ContrPosY + 11)
- ContrPosX = AutoIT.ControlGetPosX("Einstellungen", "", "[NAME:TabControl1]")
- ContrPosY = AutoIT.ControlGetPosY("Einstellungen", "", "[NAME:TabControl1]")
- AutoIT.MouseClick("left", ContrPosX + 126, ContrPosY + 12)
- ContrPosX = AutoIT.ControlGetPosX("Einstellungen", "Benutzerdefiniert", "[NAME:Button7]")
- ContrPosY = AutoIT.ControlGetPosY("Einstellungen", "Benutzerdefiniert", "[NAME:Button7]")
- AutoIT.MouseClick("left", ContrPosX + 74, ContrPosY + 11)
- AutoIT.Sleep(500)
- ContrPosX = AutoIT.ControlGetPosX("Farbe", "", "[CLASS:Static; INSTANCE:2]")
- ContrPosY = AutoIT.ControlGetPosY("Farbe", "", "[CLASS:Static; INSTANCE:2]")
- AutoIT.MouseClick("left", ContrPosX + 196, ContrPosY + 121)
- ContrPosX = AutoIT.ControlGetPosX("Farbe", "OK", "[CLASS:Button; INSTANCE:2]")
- ContrPosY = AutoIT.ControlGetPosY("Farbe", "OK", "[CLASS:Button; INSTANCE:2]")
- AutoIT.MouseClick("left", ContrPosX + 34, ContrPosY + 13)
- ContrPosX = AutoIT.ControlGetPosX("Einstellungen", "", "[NAME:TabControl1]")
- ContrPosY = AutoIT.ControlGetPosY("Einstellungen", "", "[NAME:TabControl1]")
- AutoIT.MouseClick("left", ContrPosX + 179, ContrPosY + 10)
- ContrPosX = AutoIT.ControlGetPosX("Einstellungen", "Schrift 2", "[NAME:Button16]")
- ContrPosY = AutoIT.ControlGetPosY("Einstellungen", "Schrift 2", "[NAME:Button16]")
- AutoIT.MouseClick("left", ContrPosX + 49, ContrPosY + 10)
- ContrPosX = AutoIT.ControlGetPosX("Einstellungen", "benutzerdefiniert", "[NAME:Button20]")
- ContrPosY = AutoIT.ControlGetPosY("Einstellungen", "benutzerdefiniert", "[NAME:Button20]")
- AutoIT.MouseClick("left", ContrPosX + 48, ContrPosY + 12)
- AutoIT.Sleep(500)
- ContrPosX = AutoIT.ControlGetPosX("Schriftart", "", "[CLASS:ComboLBox; INSTANCE:3]")
- ContrPosY = AutoIT.ControlGetPosY("Schriftart", "", "[CLASS:ComboLBox; INSTANCE:3]")
- AutoIT.MouseClick("left", ContrPosX + 11, ContrPosY + 34)
- ContrPosX = AutoIT.ControlGetPosX("Schriftart", "OK", "[CLASS:Button; INSTANCE:5]")
- ContrPosY = AutoIT.ControlGetPosY("Schriftart", "OK", "[CLASS:Button; INSTANCE:5]")
- AutoIT.MouseClick("left", ContrPosX + 38, ContrPosY + 12)
- ContrPosX = AutoIT.ControlGetPosX("Einstellungen", "", "[NAME:TabControl1]")
- ContrPosY = AutoIT.ControlGetPosY("Einstellungen", "", "[NAME:TabControl1]")
- AutoIT.MouseClick("left", ContrPosX + 236, ContrPosY + 11)
- ContrPosX = AutoIT.ControlGetPosX("Einstellungen", "", "[NAME:TrackBar1]")
- ContrPosY = AutoIT.ControlGetPosY("Einstellungen", "", "[NAME:TrackBar1]")
- AutoIT.MouseClickDrag("left", ContrPosX + 299, ContrPosY + 12, ContrPosX + 242, ContrPosY + 11)
- ContrPosX = AutoIT.ControlGetPosX("Einstellungen", "", "[NAME:TabControl1]")
- ContrPosY = AutoIT.ControlGetPosY("Einstellungen", "", "[NAME:TabControl1]")
- AutoIT.MouseClick("left", ContrPosX + 294, ContrPosY + 10)
- ContrPosX = AutoIT.ControlGetPosX("Einstellungen", "Immer im Vordergrund", "[NAME:CheckBox1]")
- ContrPosY = AutoIT.ControlGetPosY("Einstellungen", "Immer im Vordergrund", "[NAME:CheckBox1]")
- AutoIT.MouseClick("left", ContrPosX + 5, ContrPosY + 8)
- AutoIT.WinActivate("Einstellungen")
- ContrPosX = AutoIT.ControlGetPosX("Einstellungen", "Schließen", "[NAME:Button14]")
- ContrPosY = AutoIT.ControlGetPosY("Einstellungen", "Schließen", "[NAME:Button14]")
- AutoIT.MouseClick("left", ContrPosX + 39, ContrPosY + 11)
- End Sub
Ich weiß, das ist nicht wirklich professionell, aber ich mache das eigentlich nur nebenher und nur für mich.
*Topic verschoben*
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Marcus Gräfe“ ()