Hi,
Ich arbeite an einem Admin Tool.
Das Konsolen Fenster wird per StdoutRead ausgelesen und in Edit 1 geschrieben, in Input 1 wird ein Befehl geschrieben und per Button an das Konsolen Programm gesendet.
Zum Beispiel sende ich say hello, kommt der befehl in Edit1 so an:Game message: Anonymous (All): hello
Nun, meine Frage ist: Wie kann ich wenn der Befehl ausgeführt wurde das Ergebnis in Edit2 schreiben?
Ich habe vieles ausprobiert und getestet, konnte aber keine Lösung finden.
[Blockierte Grafik: http://s19.postimg.org/56g62hglr/Server_launcher_pic.jpg]
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <GuiEdit.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 835, 439, 192, 124)
$Edit1 = GUICtrlCreateEdit("", 419, 29, 398, 387)
GUICtrlSetData(-1, "line")
$Edit2 = GUICtrlCreateEdit("", 15, 215, 398, 200)
$Button1 = GUICtrlCreateButton("Button2", 151, 60, 75, 25)
$Input1 = GUICtrlCreateInput("", 149, 30, 222, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$fc = Run("C:\Program Files (x86)\Ubisoft\Far Cry 2\bin\FC2ServerLauncher.exe", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
[/autoit] [autoit][/autoit] [autoit]While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$i = GUICtrlRead($Input1)
WinActivate("[Class:ConsoleWindowClass]")
WinWaitActive ("[Class:ConsoleWindowClass]")
Send($i &"{Enter}")
EndSwitch
[/autoit] [autoit][/autoit] [autoit]$line = StdoutRead($fc)
If @error Then ExitLoop
If $line <> "" Then
GUICtrlSetData($Edit1,"" & $line,1 )
EndIf
WEnd
While 1
$line = StderrRead($fc)
If @error Then ExitLoop
ConsoleWrite("STDERR read:"& $line)
WEnd