#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <String.au3>
#Include <GuiEdit.au3>
HotKeySet("{F7}","quit")
Func quit()
ProcessClose("cmd.exe")
Exit 0
EndFunc
Global $PT=0
$HDL=Run(@ComSpec,"",@SW_HIDE,$STDIN_CHILD+$STDOUT_CHILD+$STDERR_CHILD)
$GUIID=GUICreate("CMDshell",600,750)
$DISP=GUICtrlCreateEdit("",10,10,580,700,$Es_READONLY+$WS_VSCROLL)
;;GUICtrlSetStyle($DISP,$WS_VSCROLL)
GUICtrlSetBkColor($DISP,0x000000)
GUICtrlSetColor($DISP,0xFFFFFF)
$CMDS=GUICtrlCreateInput("commands...",10,720,530,20)
GUICtrlSetBkColor($CMDS,0x000000)
GUICtrlSetColor($CMDS,0xFFFFFF)
$BUTN=GUICtrlCreateButton("Execute",540,720,50,20)
GUICtrlSetBkColor($BUTN,0x000000)
GUICtrlSetColor($BUTN,0x00FF00)
GUISetBkColor(0x000000)
GUISetState()
Global $echo=""
While 1
$guimsg=GUIGetMsg()
Switch $guimsg
Case $GUI_EVENT_CLOSE
quit()
Case $BUTN
StdinWrite($HDL,GUICtrlRead($CMDS)&@CRLF)
EndSwitch
Sleep(1)
$msg=StdoutRead($HDL)
ConsoleWrite($msg&@CRLF)
;~ MsgBox(0,0,$msg)
If $msg <> "" Then
;~ MsgBox(0,"$",S($echo,$msg));;这里就是BUG
$echo=S($echo,$msg);;不管怎样都无效!换成"$echo&=$msg"无效,换成"$echo=$echo&$msg"无效,写成自定义函数无效,用UDF"_StringInsert"还是无效,我是遇到神一样的BUG了么?
;~ MsgBox(0,1,$echo)
_GUICtrlEdit_AppendText($DISP,$msg)
;~ GUICtrlSetData($DISP,$echo)
$msg=""
EndIf
WEnd
Func S($s1,$s2)
Return($s1&$s2)
EndFunc
|