#NoTrayIcon #include #include #include #include Global $Form = GUICreate("Console", @DesktopWidth, @DesktopHeight, 0, 0, BitOR($WS_POPUP, $DS_SETFOREGROUND), 0) GUISetBkColor(0x000000) ;[TODO:] _GUICtrlRichEdit_Create for multiple colors. Global $Console = GUICtrlCreateEdit('Loading...', 32, 32, @DesktopWidth - 15, @DesktopHeight - 64, $ES_AUTOVSCROLL, $WS_TABSTOP) GUICtrlSetFont(-1, 16, 400, 0, 'OCR A Extended') GUICtrlSetColor(-1, 0x00FF00) GUICtrlSetBkColor(-1, 0) GUICtrlSetCursor (-1, 2) GUICtrlSendMsg(-1, $EM_LIMITTEXT, -1, 0);disable edit character limit... _GUICtrlEdit_SetMargins(-1, $EC_RIGHTMARGIN, Default, 49) Load() Func Load() DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $form, "int", 160, "long", 0x00080000) GUISetState(@SW_SHOWNORMAL) EndFunc Global $prompt = "Command: " Global $Prompt_Edge = StringLen($prompt) Global $Old_Sel, $Sel, $Old_Command, $Command #Region i'm using hotkeys here for the sake of simplicity but you can do this with "GUISetAccelerators($aKeys)" to... HotKeySet('{esc}','Quit') HotKeySet('{up}','History') HotKeySet('{down}','History') HotKeySet('{bs}','SpecialKey') HotKeySet('{tab}','SpecialKey') HotKeySet('{enter}','EnterKey') #EndRegion GUICtrlSetData($Console, $prompt) GUICtrlSetState($Console,$GUI_FOCUS) Beep(4000,50) While True If GUIGetMsg() = $GUI_EVENT_CLOSE Then quit() $sel = _GUICtrlEdit_GetSel($Console) If $sel <> $Old_Sel Then $Old_Sel = $Sel If $sel[0] < $Prompt_Edge Then If $sel[0] > $sel[1] Then _GUICtrlEdit_SetSel($Console, $Prompt_Edge, $sel[1]) ElseIf $sel[0] < $sel[1] Then _GUICtrlEdit_SetSel($Console, $sel[1], $Prompt_Edge) Else _GUICtrlEdit_SetSel($Console, $Prompt_Edge, $Prompt_Edge) EndIf EndIf EndIf WEnd Func EnterKey();here you can make a custom command switch or use my dll when finished... Local $command = StringLower(StringStripWS(StringRight(GUICtrlRead($Console), StringLen(GUICtrlRead($Console)) - $Prompt_Edge),7));or stringregex... If $command <> $Old_Command Then $Old_Command = $command Switch $command Case '' Beep(4000,50) Case 'quit', 'stop', 'exit', 'close' quit() Case 'clear', 'cls' GUICtrlSetData($console,'') _GUICtrlEdit_AppendText($Console, $prompt) $Prompt_Edge = _GUICtrlEdit_GetSel($console)[0] Return Case 'help' _GUICtrlEdit_AppendText($Console, @CRLF & @TAB & 'quit, stop, exit or close = quit console.' & @CRLF & @TAB & 'clear, cls = clear screen.' & @CRLF & @TAB & 'help = display this help list.') Case Else Beep(500,50) _GUICtrlEdit_AppendText($Console, @CRLF & @TAB & 'Unknown command!') EndSwitch _GUICtrlEdit_AppendText($Console, @CRLF & $prompt) $Prompt_Edge = _GUICtrlEdit_GetSel($console)[0] EndFunc Func History();we could use an array here to store more commands... _GUICtrlEdit_SetSel($Console, $Prompt_Edge, StringLen(GUICtrlRead($Console))) _GUICtrlEdit_ReplaceSel($Console, $Old_Command) EndFunc Func SpecialKey() Local $key = @HotKeyPressed Switch $key Case '{bs}' If $sel[0] >= $Prompt_Edge Then If $sel[0] = $sel[1] And $sel[0] > $Prompt_Edge And $sel[1] > $Prompt_Edge Then _GUICtrlEdit_SetSel($Console, $sel[0] - 1, $sel[0]) _GUICtrlEdit_ReplaceSel($Console, '') EndIf Case '{tab}' _GUICtrlEdit_ReplaceSel($Console, @TAB) EndSwitch EndFunc Func Quit() _GUICtrlEdit_AppendText($Console, @CRLF & @TAB & 'Goodbye!') DllCall("User32.dll", "int", "AnimateWindow", "hwnd", $Form, "int", 160, "long", 0x00090000) Exit EndFunc