Bestimmter Text in Edit unlöschbar

  • Script :

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <WindowsConstants.au3>
    #include <EditConstants.au3>
    #include <Misc.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $hWnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    HotKeySet("{ENTER}","pressed")

    [/autoit] [autoit][/autoit] [autoit]

    Global $Konsole = _Konsol_Create("Konsole","Test")
    ;=================================================================================================
    ; Function: _Konsol_Create
    ; Varibles: $title = Titel der Konsole
    ; $text = Text des Labels
    ; Author: SB
    ;=================================================================================================
    Func _Konsol_Create($title,$text)
    Local $dll = DllOpen("user32.dll")
    Dim $hWnd[2]
    $hWnd[0] = GUICreate($title,500,300)
    GUISEtBkColor(0x000000)
    $hWnd[1] = GUICtrlCreateEdit("",0,0,500,300,BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL), 0)
    GUICtrlSETBKColor(-1,0x000000)
    GUICTrlSETColor(-1,0xDCDCDC)
    GUICtrlSEtFont(-1,10,400,17,"Georgia")
    GUISetState(@SW_SHOW)
    While 1
    Switch GUIGETMSG()
    Case -3
    GUISetState(@SW_HIDE,$hWnd[0])
    Exitloop
    EndSwitch
    WEnd
    Return $hWnd
    EndFunc
    Func pressed()
    Dim $Befehle[5]
    $Befehle[0] = "time"
    $Befehle[1] = "date"
    $Befehle[2] = "ip"
    $Befehle[3] = "pcname"
    $Befehle[4] = "username"
    $read = GUICTrlREad($hWnd[1])
    $Split = StringSplit($read, @CRLF)
    $uUbound = UBound($Split)
    $text = $Split[$uUbound-1]
    IF $Split[$uUbound-1] = "" Then
    GUICtrlSetData($hWnd[1],$read & @CRLF & @CRLF&" "& "Bitte Text Eingeben"& @CRLF& @Crlf )
    Endif
    If $Split[$uUbound-1] = $Befehle[0] Or $text = $Befehle[0] & "" Or $text = $Befehle[0] & " " Then
    GUICtrlSetData($hWnd[1],$read & @CRLF & " " & @Hour & ":" & @Min & @CRLF & @Crlf )
    Endif
    If $text = $Befehle[1] Or $text = $Befehle[1] & "" Or $text = $Befehle[1] & " " Then
    GUICtrlSetData($hWnd[1],$read & @CRLF & " " & @MDAY & ":" & @Mon & ":"& @Year & @CRLF & @Crlf )
    Endif
    If $text = $Befehle[2] Or $text = $Befehle[2] & "" Or $text = $Befehle[2] & " " Then
    GUICtrlSetData($hWnd[1],$read & @CRLF & " " & @IPAddress1 & @CRLF & @Crlf )
    Endif
    If $text = $Befehle[3] Or $text = $Befehle[3] & "" Or $text = $Befehle[3] & " " Then
    GUICtrlSetData($hWnd[1],$read & @CRLF & " " & @ComputerName & @CRLF & @Crlf )
    Endif
    If $text = $Befehle[4] Or $text = $Befehle[4] & "" Or $text = $Befehle[4] & " " Then
    GUICtrlSetData($hWnd[1],$read & @CRLF & " " & @Username & @CRLF & @Crlf )
    Endif
    EndFunc

    [/autoit]

    Wie kann ich es machen , dass alte Befehle unlöschbar sind

    Ich hoffe mir kann jemand helfen

  • So:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <WindowsConstants.au3>
    #include <EditConstants.au3>
    #include <Misc.au3>
    #include <GuiEdit.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $hWnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    HotKeySet("{ENTER}","pressed")

    [/autoit] [autoit][/autoit] [autoit]

    Global $Konsole = _Konsol_Create("Konsole","Test")
    ;=================================================================================================
    ; Function: _Konsol_Create
    ; Varibles: $title = Titel der Konsole
    ; $text = Text des Labels
    ; Author: SB
    ;=================================================================================================
    Func _Konsol_Create($title,$text)
    Local $dll = DllOpen("user32.dll")
    Dim $hWnd[3]
    $hWnd[0] = GUICreate($title,500,300)
    GUISEtBkColor(0x000000)
    $hWnd[1] = GUICtrlCreateEdit("",0,0,500,300,BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL,0x08000000), 0)
    GUICtrlSETBKColor(-1,0x000000)
    GUICTrlSETColor(-1,0xDCDCDC)
    GUICtrlSEtFont(-1,10,400,17,"Georgia")
    $hWnd[2] = GUICtrlCreateInput ("",0,0,483,20,$ES_AUTOHSCROLL,0)
    GUICtrlSETBKColor(-1,0x000000)
    GUICTrlSETColor(-1,0xDCDCDC)
    GUICtrlSEtFont(-1,10,400,17,"Georgia")
    GUISetState(@SW_SHOW)
    While 1
    Switch GUIGETMSG()
    Case -3
    GUISetState(@SW_HIDE,$hWnd[0])
    Exitloop
    EndSwitch
    WEnd
    Return $hWnd
    EndFunc
    Func pressed()
    Dim $Befehle[5]
    $Befehle[0] = "time"
    $Befehle[1] = "date"
    $Befehle[2] = "ip"
    $Befehle[3] = "pcname"
    $Befehle[4] = "username"
    $text = GUICTrlREad($hWnd[2])
    $read = GUICTrlREad($hWnd[1])
    GUICtrlSetData ($hWnd[2],"")
    IF $text = "" Then
    GUICtrlSetData($hWnd[1],$read & @CRLF & @CRLF&" "& "Bitte Text Eingeben"& @CRLF& @Crlf )
    Endif
    If $text = $Befehle[0] Or $text = $Befehle[0] & "" Or $text = $Befehle[0] & " " Then
    GUICtrlSetData($hWnd[1],$read & $text & @CRLF & " " & @Hour & ":" & @Min & @CRLF & @Crlf )
    Endif
    If $text = $Befehle[1] Or $text = $Befehle[1] & "" Or $text = $Befehle[1] & " " Then
    GUICtrlSetData($hWnd[1],$read & $text & @CRLF & " " & @MDAY & ":" & @Mon & ":"& @Year & @CRLF & @Crlf )
    Endif
    If $text = $Befehle[2] Or $text = $Befehle[2] & "" Or $text = $Befehle[2] & " " Then
    GUICtrlSetData($hWnd[1],$read & $text & @CRLF & " " & @IPAddress1 & @CRLF & @Crlf )
    Endif
    If $text = $Befehle[3] Or $text = $Befehle[3] & "" Or $text = $Befehle[3] & " " Then
    GUICtrlSetData($hWnd[1],$read & $text & @CRLF & " " & @ComputerName & @CRLF & @Crlf )
    Endif
    If $text = $Befehle[4] Or $text = $Befehle[4] & "" Or $text = $Befehle[4] & " " Then
    GUICtrlSetData($hWnd[1],$read & $text & @CRLF & " " & @Username & @CRLF & @Crlf )
    Endif
    $Pos = _GUICtrlEdit_PosFromChar ($hWnd[1],_GUICtrlEdit_GetTextLen($hWnd[1]) -1)
    GUICtrlSetPos ($hWnd[2],0,$Pos[1]+16)
    EndFunc

    [/autoit]

    mfg. Jam00