Scrollleiste bei GUI bzw. MsgBox

  • Hi, ich hab ein dringendes Problem: Ich muss bis heut Mittag ein Programm fertighaben, dass mir eine Ausgabe einer rel. schmalen, dafür ziemlich langen Liste ausspuckt.Siehe Zeile 96/97 => Ausgabe der IP-Adresse, wird bei entsprechend vielen Netzwerkkarten ziemlich lange Ich habe entweder die Möglichkeit eine msgbox dafür zu verwenden oder eben in meine GUI-Liste zu verwenden. Nur ist aber bei er msgbox das Problem, dass bei zu kleinen Auflösungen nicht das ganze Fenster auf den Bildschirm passt und dann einfach abgeschnitten wird. Ist es nicht möglich dis abzufangen und bei z.B. einer maximalen Pixelanzahl eine BILdlaufleiste einzublenden?

    Alternativ das ganze innerhalb meine Gui-Liste, auch mit Bildlaufleiste
    => Dort ist aber zusätzlich das Problem, dass die Daten nicht richtig den Zeilensprung machen, sprich "Alles wird in eine Zeile ausgegeben" (bei er msgbox geht das aber !)

    Siehe Spoiler. Wär schön, wenns ne Lösung für mich gibt. THX

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <ServiceControl.au3>
    #include <Constants.au3>
    #Include <GuiList.au3>

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

    ;checks if another instance of this script runs simultaneously
    $g_szVersion = "Servicescript Ver. 1.8"
    If WinExists($g_szVersion) Then Exit ; It's already running
    AutoItWinSetTitle($g_szVersion)

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

    ; create global variables
    Global $button_exit_child, $button_ok_child,$text, $username, $ipconfig = "ipconfig", $cmd = "cmd /T:1F /K", $gpupdate = "gpupdate /force", $nslookup = "nslookup", $tracert = "tracert", $remoteaccess = "rcimlby.exe -LaunchRA"

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

    ; create the main gui-surface
    $main = GUICreate("Service-Script V1.8", 650, 490)
    GUISetState(@SW_SHOW)
    $string = "Bitte wählen Sie eines der folgenden Programme aus, in dem Sie den entsprechenden Button auswählen und mit OK bestätigen. Zum Beenden des Programms, bitte Exit wählen. Zum Löschen der Anzeige, Clear wählen."
    GUICtrlCreateLabel(_StringInsertLF($String,60),10,15)
    $button_ok = GUICtrlCreateButton("OK", 10, 120, 200, 35, -1, -1)
    $button_clear = GUICtrlCreateButton("Clear", 10, 170, 90, 35, -1, -1)
    $button_exit = GUICtrlCreateButton("Exit", 125, 170, 90, 35, -1, -1)
    $out = GUICtrlCreateList("", 10, 230, 320, 250, ($ws_vscroll + $WS_BORDER + $LBS_NOTIFY + $LBS_NOINTEGRALHEIGHT))
    GUISetIcon("trash.ico", 0)
    GUISetState()

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

    GUICtrlCreateLabel(@ComputerName, 360, 30, 270, 20)
    GUICtrlCreateGroup("1. Ihr PC-Name ist: ", 340, 10, 300, 50)
    GUICtrlCreateGroup("5. Admin Tools", 340, 390, 300, 90)
    GUICtrlCreateGroup("4. Windows Tools", 340, 290, 300, 90)
    GUICtrlCreateGroup("3. Netzwerktools", 340, 170, 300, 110)
    GUICtrlCreateGroup("2. Ausführen des Ping auf Rechner:", 340, 70, 300, 90)

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

    ;create radio-buttons for the different functions
    $radio_21 = GUICtrlCreateRadio("srv01mail1", 350, 90, 140, 20)
    $radio_22 = GUICtrlCreateRadio(@ComputerName, 350, 110, 140, 20)
    $radio_23 = GUICtrlCreateRadio("srv32sis", 350, 130, 140, 20)
    $radio_20 = GUICtrlCreateRadio("eigene Eingabe", 490, 90, 140, 20)
    $radio_30 = GUICtrlCreateRadio("IP-Adressen des Rechners anzeigen", 350, 190, 280, 20)
    $radio_31 = GUICtrlCreateRadio("Policy-Refresh", 350, 210, 280, 20)
    $radio_32 = GUICtrlCreateRadio("NSLOOKUP auf Ditzingen / Böblingen", 350, 230, 280, 20)
    $radio_33 = GUICtrlCreateRadio("Trace Route auf Server x", 350, 250, 280, 20)
    $radio_40 = GUICtrlCreateRadio("Computermanagement öffnen", 350, 310, 280, 20)
    $radio_41 = GUICtrlCreateRadio("Eventviewer starten", 350, 330, 280, 20)
    $radio_42 = GUICtrlCreateRadio("Windows Remote Assistance starten", 350, 350, 280, 20)
    $radio_50 = GUICtrlCreateLabel("Firewall",370,410,50,20)
    $button_off = GUICtrlCreateButton("AUS", 480, 410, 50, 15, -1, -1)
    $button_on = GUICtrlCreateButton("AN", 420, 410, 50, 15, -1, -1)
    $radio_51 = GUICtrlCreateRadio("Lokalen Benutzer entsperren", 350, 430, 280, 20)
    $radio_52 = GUICtrlCreateRadio("DOS-Box mit Adminrechten starten", 350, 450, 280, 20)

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

    ; create the child_gui for the "unlock local user" function
    $child = GUICreate("Bitte Benutzernamen eingeben", 250, 100)
    GUISetState(@SW_HIDE, $child)

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

    ; while-loop to get the state of pressed buttons
    While 1
    $msg = GUIGetMsg(1)
    Select
    Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $main ; closes the main windows by pressing "X" at the right upper corner
    Exit

    Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $child ; closes the child-gui by pressing "X" at the right upper corner, main-gui remains open
    GUISetState(@SW_HIDE, $child)

    Case $msg[0] = $button_clear And $msg[1] = $main ; deletes all enties in the listbox and unchecks the active radio_button
    ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52)

    Case $msg[0] = $button_exit ; closes complete programm by clicking the exit-button
    Exit

    Case $msg[0] = $button_exit_child ; closes the child-gui by clicking the child-exit-button
    GUISetState(@SW_Hide, $child)

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

    Case $msg[0] = $button_ok And (GUICtrlRead($radio_20) = $GUI_Checked) And $msg[1] = $main ; pings a user-defined computer
    $p = InputBox("Ping auf beliebigen Server", "Bitte einen Servernamen eingeben: ", "", " M")
    PingServ($p)

    Case $msg[0] = $button_ok And (GUICtrlRead($radio_21) = $GUI_Checked) And $msg[1] = $main ; pings srv01mail1
    PingServ("srv01mail1")

    Case $msg[0] = $button_ok And (GUICtrlRead($radio_22) = $GUI_Checked) And $msg[1] = $main ; pings localhost
    PingServ(@ComputerName)

    Case $msg[0] = $button_ok And (GUICtrlRead($radio_23) = $GUI_Checked) And $msg[1] = $main ; pings srv32sis
    PingServ("srv32sis")

    Case $msg[0] = $button_ok And (GUICtrlRead($radio_30) = $GUI_Checked) And $msg[1] = $main ; shows the IP adress and status of all connected network devices
    ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52)
    $stream = Run(@ComSpec & ' /c ' & $ipconfig, '', @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    $text = ""
    While 1
    $textline = StdoutRead($stream)
    $text = $text & @CRLF & $textline
    If @error Then ExitLoop
    WEnd
    MsgBox(0, "Die Route zum Server ist:", $text)
    GUICtrlSetData($out, _StringInsertLF($text,60))

    Case $msg[0] = $button_ok And (GUICtrlRead($radio_52) = $GUI_Checked) And $msg[1] = $main ; opens dos-shell with local administrator rights
    ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52)
    Run(@ComSpec & " /c " & $cmd, @SystemDir, @SW_SHOW)

    Case $msg[0] = $button_ok And (GUICtrlRead($radio_31) = $GUI_Checked) And $msg[1] = $main ; updates Windows Policy
    ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52)
    GUICtrlSetData($out, "Refresh der Policy startet")
    Opt("WinWaitDelay", 100)
    Opt("WinTitleMatchMode", 4)
    Opt("WinDetectHiddenText", 1)
    Opt("MouseCoordMode", 0)
    Run('C:\WINDOWS\system32\cmd.exe', "", @SW_HIDE)
    WinWait("C:\WINDOWS\system32\cmd.exe", "")
    If Not WinActive("C:\WINDOWS\system32\cmd.exe", "") Then WinActivate("C:\WINDOWS\system32\cmd.exe", "")
    WinWaitActive("C:\WINDOWS\system32\cmd.exe", "")
    Send("gpupdate /force")
    Send("{ENTER}")
    GUICtrlSetData($out, "-------------------------------------------------------------" & "|" & "Bitte warten, die Policy wird erneuert.")
    Sleep(20000)
    Send("n" & "{ENTER}" & "exit" & "{ENTER}")
    GUICtrlSetData($out, "-------------------------------------------------------------" & "|" & "Die Policy wurde erfolgreich erneuert")

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

    Case $msg[0] = $button_ok And (GUICtrlRead($radio_32) = $GUI_Checked) And $msg[1] = $main ; runs nslookup of a user defined computer
    ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52)
    $server = InputBox("Nslookup auf Server X", "Bitte den Servernamen eingeben: ", "", " M")
    IF @error=1 Then
    Sleep(1)
    Else
    $stream = Run(@ComSpec & ' /c ' & $nslookup & " " & $server, '', @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    $text = ""
    While 1
    $textline = StdoutRead($stream)
    $text = $text & @CRLF & $textline
    If @error Then ExitLoop
    WEnd
    MsgBox(0, "Ergebnis:", _StringInsertLF($text,50))
    EndIf

    Case $msg[0] = $button_ok And (GUICtrlRead($radio_33) = $GUI_Checked) And $msg[1] = $main ; opens traceroute of a user defined computer
    ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52)
    $server = InputBox("Traceroute auf Server X", "Bitte den Servernamen eingeben: ", "", " M")
    IF @error=1 Then
    Sleep(1)
    Else
    Tracert($server)

    EndIf

    Case $msg[0] = $button_ok And (GUICtrlRead($radio_40) = $GUI_Checked) And $msg[1] = $main; opens computermanagement
    ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52)
    Run(@ComSpec & " /c " & 'compmgmt.msc', "", @SW_HIDE)

    Case $msg[0] = $button_ok And (GUICtrlRead($radio_41) = $GUI_Checked) And $msg[1] = $main; opens windows eventviewer
    ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52)
    Run(@ComSpec & " /c " & 'eventvwr.msc', "", @SW_HIDE)

    Case $msg[0] = $button_ok And (GUICtrlRead($radio_42) = $GUI_Checked) And $msg[1] = $main; starts Windows Remote Assistance
    ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52)
    Run($remoteaccess)

    Case $msg[0] = $button_on And $msg[1] = $main; starts Windows Firewall service "sharedaccess"
    ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52)
    _startService ("", "sharedaccess")
    $err = @error
    Select
    Case $err = 0
    GUICtrlSetData($out, "Die Windows Firewall wurde aktiviert")
    Case $err = 1056
    GUICtrlSetData($out, "Der Windows-Firewalldienst ist bereits aktiv")
    Case Else
    GUICtrlSetData($out, "Es sind Fehler aufgetreten,|der Dienst konnte nicht erfolgreich gestartet werden |Evtl fehlen die Admin-Berechtigungen")
    EndSelect

    Case $msg[0] = $button_off And $msg[1] = $main; stopps Windows Firewall service "sharedaccess"
    ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52)
    _StopService ("", "sharedaccess")
    $err = @error
    Select
    Case $err = 0
    GUICtrlSetData($out, "Die Windows Firewall wurde erfolgreich beendet")
    Case $err = 1062
    GUICtrlSetData($out, "Der Windows-Firewalldienst war bereits beendet")
    Case Else
    GUICtrlSetData($out, "Es sind Fehler aufgetreten,|der Dienst konnte nicht erfolgreich beendet werden |Evtl fehlen die Admin-Berechtigungen")
    EndSelect

    Case $msg[0] = $button_ok And (GUICtrlRead($radio_51) = $GUI_Checked) And $msg[1] = $main; unlocks a local user, sets password to "initinit" and sets "user must change password at next logon"
    ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52)
    $input = InputBox("Unlock User","Bitte Benutzernamen eingeben:")
    If $input = "Administrator" or $input = "Gast" or $input="guest" or $input = "" Then
    $string="Administrator und Gast-Benutzer können nicht entsperrt werden. Bitte wählen Sie einen anderen Benutzer aus. Außerdem müssen Sie zwingend einen existenten Benutzer eingeben."
    MsgBox(0,"",_StringInsertLF($String,50))
    Else
    $cusrmgr = "c:\windows\cusrmgr -u " & $input & " +s AccountLockout -s AccountDisabled +s MustChangePassword +p initinit"
    Run($cusrmgr)
    Sleep(2000)
    MsgBox(0,"","Der Benutzer " & $input & " wurde erfolgreich entsperrt.")
    EndIf

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

    EndSelect
    WEnd

    Func ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52) ; resets all radio buttons and the listbox
    _GUICtrlListClear($out)
    GUICtrlSetState($radio_20, $GUI_unchecked)
    GUICtrlSetState($radio_21, $GUI_unchecked)
    GUICtrlSetState($radio_22, $GUI_unchecked)
    GUICtrlSetState($radio_23, $GUI_unchecked)

    GUICtrlSetState($radio_30, $GUI_unchecked)
    GUICtrlSetState($radio_31, $GUI_unchecked)
    GUICtrlSetState($radio_32, $GUI_unchecked)
    GUICtrlSetState($radio_33, $GUI_unchecked)

    GUICtrlSetState($radio_40, $GUI_unchecked)
    GUICtrlSetState($radio_41, $GUI_unchecked)
    GUICtrlSetState($radio_42, $GUI_unchecked)

    GUICtrlSetState($radio_50, $GUI_unchecked)
    GUICtrlSetState($radio_51, $GUI_unchecked)
    GUICtrlSetState($radio_52, $GUI_unchecked)
    EndFunc ;==>ClearFields

    Func PingServ($ping) ; function for pinging computers on the network
    ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52)
    GUICtrlSetData($out, "Please wait...")
    Dim $Prt, $ProgName, $Optionen, $MaxB = 0, $i, $PrtArray
    $i = Run(@ComSpec & " /c ping " & $ping, @SystemDir, @SW_HIDE, $STDOUT_CHILD + $STDERR_CHILD)
    ProcessWaitClose($i)
    $h = StdoutRead($i)
    If @error = 0 Then $Prt = $h
    $h = StderrRead($i)
    If @error = 0 Then $Prt = $h
    $Prt = StringReplace($Prt, Chr(154), "Ü")
    $Prt = StringReplace($Prt, Chr(129), "ü")
    $Prt = StringReplace($Prt, Chr(142), "Ä")
    $Prt = StringReplace($Prt, Chr(132), "ä")
    $Prt = StringReplace($Prt, Chr(153), "Ö")
    $Prt = StringReplace($Prt, Chr(148), "ö")
    $Prt = StringReplace($Prt, Chr(10), "")
    $Zeilen = StringSplit($Prt, @CR)
    ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52)
    For $v = 1 To $Zeilen[0] Step 1
    If StringLen(StringStripWS($Zeilen[$v], 8)) > 0 Then
    GUICtrlSetData($out, ($Zeilen[$v]) & "|")
    EndIf
    Next
    EndFunc

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

    Func Tracert($server) ; function for pinging computers on the network
    ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52)
    GUICtrlSetData($out, "Please wait...")
    Dim $Prt, $ProgName, $Optionen, $MaxB = 0, $i, $PrtArray
    $i = Run(@ComSpec & $tracert & $server, @SystemDir, @SW_HIDE, $STDOUT_CHILD + $STDERR_CHILD)
    ProcessWaitClose($i)
    $h = StdoutRead($i)
    If @error = 0 Then $Prt = $h
    $h = StderrRead($i)
    If @error = 0 Then $Prt = $h
    $Prt = StringReplace($Prt, Chr(154), "Ü")
    $Prt = StringReplace($Prt, Chr(129), "ü")
    $Prt = StringReplace($Prt, Chr(142), "Ä")
    $Prt = StringReplace($Prt, Chr(132), "ä")
    $Prt = StringReplace($Prt, Chr(153), "Ö")
    $Prt = StringReplace($Prt, Chr(148), "ö")
    $Prt = StringReplace($Prt, Chr(10), "")
    $Zeilen = StringSplit($Prt, @CR)
    ClearFields($out,$radio_20,$radio_21,$radio_22,$radio_23,$radio_30,$radio_31,$radio_32,$radio_33,$radio_40,$radio_41,$radio_42,$radio_50,$radio_51,$radio_52)
    For $v = 1 To $Zeilen[0] Step 1
    If StringLen(StringStripWS($Zeilen[$v], 8)) > 0 Then
    GUICtrlSetData($out, ($Zeilen[$v]) & "|")
    EndIf
    Next
    EndFunc

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

    Func _StringInsertLF($strString,$nCount,$cBreaking = 0)

    Local $strRetString = "", $nPos

    Do
    If Stringlen($strString) > $nCount Then
    $nPos = StringInStr(StringLeft($strString,$nCount + 1)," ",0,-1)
    If ($nPos and $cBreaking = 0) Then
    $strRetString &= StringLeft($strString,$nPos - 1) & @LF
    $strString = StringMid($strString,$nPos + 1)
    Else
    $strRetString &= StringLeft($strString,$nCount) & @LF
    $strString = StringMid($strString,$nCount + 1)
    EndIf
    EndIf
    Until StringLen($strString) < $nCount

    $strRetString &= $strString

    Return $strRetString
    EndFunc

    [/autoit]

    Einmal editiert, zuletzt von greetzz (31. Januar 2007 um 09:06)

    • Offizieller Beitrag

    Hi,

    hilft dir sowas?

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <Constants.au3>
    #Include <GuiListView.au3>

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

    GUICreate("listview items", 520, 350, 100, 200, -1)
    GUISetBkColor(0x00E0FFFF) ; will change background color

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

    $listview = GUICtrlCreateListView("Spalte1", 10, 10, 400, 250, Default, $LVS_EX_GRIDLINES)
    _GUICtrlListViewSetColumnWidth(-1, 0, $LVSCW_AUTOSIZE_USEHEADER)
    $button = GUICtrlCreateButton("Value?", 20, 280, 70, 20)
    $input1 = GUICtrlCreateInput("", 20, 300, 150)
    GUISetState()

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

    Do
    $msg = GUIGetMsg()
    Select
    Case $msg = $button
    _start()
    Case $msg = $listview
    MsgBox(0, "listview", "clicked=" & GUICtrlGetState($listview), 2)
    EndSelect
    Until $msg = $GUI_EVENT_CLOSE

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

    Func _start()
    $stream = Run(@ComSpec & ' /c ' & " ipconfig ", '', @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    $text = ""
    While 1
    $textline = StdoutRead($stream)
    $text &= @CRLF & $textline
    If @error Then ExitLoop
    WEnd
    $a = StringSplit($text, @CRLF)
    For $i = 1 To UBound($a) - 1
    If $a[$i] <> "" Then
    GUICtrlCreateListViewItem($a[$i], $listview)
    EndIf
    Next
    EndFunc ;==>_start

    [/autoit]

    So long,

    Mega

  • Ja, das hört sich doch gut an. Funktioniert einwandfrei. Muss jetzt nur noch schauen, wieso der bei der PIN-Funktion keinen horiz.Scrollbalken bekomme, bei der IP-Ausgabe aber schon....*hmm*

  • @ th.meger

    ähm, hallo....

    ich weiß jetzt nicht so recht ob ich ein neues thema dafür aufmachen soll ??
    ich frag ma direkt hier.

    ich verwende ein compiler tool zum compilieren von "HTML Help Workshop"
    dateien, also für selbsterstellte Windows Hilfen mit HTML dateien.
    Ich würde gerne obiges script verwenden doch ich habe leider 2 kleine problemchen:
    1. funktioniert es nicht wenn im Pfad ein leerzeichen ist z.B.
    c:\program files\HTML Workshop\hhc.exe s:\workshop.hhp
    2. das compilieren dauert ein wenig und man bekommt erst etwas angezeigt wenns komplet durchgelaufen ist.

    geht das irgendwie das man das zeilenweise angezeigt bekommt, so wie im DOS Fenster ?

    Ich habe leider noch nichts anderes gefunden außer etwas mit DOSBOX,
    da hab ich aber die gleichen problemchen.

    Besten Dank schoma

    • Offizieller Beitrag

    Hallo!

    Pfade mit Leerzeichen müssen von Anführungszeichen umschlossen werden:

    [autoit]

    '"c:\program files\HTML Workshop\hhc.exe" s:\workshop.hhp'

    [/autoit]
    • Offizieller Beitrag

    Evtl. indem man die Funktion _start etwas umschreibt!

    [autoit]

    Func _start()
    $stream = Run(@ComSpec & ' /c ' & " ipconfig ", '', @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    While 1
    $textline = StdoutRead($stream)
    If @error Then ExitLoop
    $a = StringSplit($textline, @CRLF)
    For $i = 1 To $a[0]
    If $a[$i] <> "" Then
    GUICtrlCreateListViewItem($a[$i], $listview)
    EndIf
    Next
    WEnd
    EndFunc ;==>_start

    [/autoit]
    • Offizieller Beitrag

    Du kannst die DosBox einfach sichtbar machen, beim Run-Befehl einfach das @SW_HIDE durch @SW_SHOW ersetzen!

  • danke, aber leider nicht.....

    ich habe da aber etwas gefunden, und zwar HIER

    genau soetwas hab ich gesucht.....
    ich hab da mal ein bissel rumgebastelt, aber ich bekomme die formatierung
    nicht so richtig hin. wenn man etwas kopiert siehts schon recht gut aus...

    vieleicht hat jemand ja ne idee....

    Spoiler anzeigen
    [autoit]


    Opt("MustDeclareVars", 1)

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

    #include <A3LPipes.au3>
    #include <A3LWinAPI.au3>

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

    GuiCreate("MyGUI", 715, 530,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

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

    $List_1 = GuiCtrlCreateList("", 10, 10, 570, 420)
    $Button_2 = GuiCtrlCreateButton("Go", 291, 450, 99, 31)
    $Button_3 = GuiCtrlCreateButton("Exit", 90, 440, 90, 40)

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

    GuiSetState()
    While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE or $msg = $Button_3
    ExitLoop

    Case $msg = $Button_2
    ;~ ExecuteCmd("cmd.exe /c dir C:\")

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

    ExecuteCmd("cmd.exe /c copy ""E:\Freigaben\Intern\--== NEUE PROGS ==--\AutoIt\*.exe"" c:\temp")

    Case Else
    ;;;
    EndSelect
    WEnd
    Exit

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

    Func ExecuteCmd($sCmd)
    Global $iBytes, $sData, $hReadPipe, $hWritePipe, $tBuffer, $tProcess, $tSecurity, $tStartup

    ; Set up security attributes
    $tSecurity = DllStructCreate($tagSECURITY_ATTRIBUTES)
    DllStructSetData($tSecurity, "Length" , DllStructGetSize($tSecurity))
    DllStructSetData($tSecurity, "InheritHandle", True)

    ; Create a pipe for the child process's STDOUT
    _Pipe_CreatePipe($hReadPipe, $hWritePipe, $tSecurity)

    ; Create child process
    $tProcess = DllStructCreate($tagPROCESS_INFORMATION)
    $tStartup = DllStructCreate($tagSTARTUPINFO)
    DllStructSetData($tStartup, "Size" , DllStructGetSize($tStartup))
    DllStructSetData($tStartup, "Flags" , BitOR($STARTF_USESTDHANDLES, $STARTF_USESHOWWINDOW))
    DllStructSetData($tStartup, "StdOutput", $hWritePipe)
    DllStructSetData($tStartup, "StdError" , $hWritePipe)
    _API_CreateProcess("", $sCmd, 0, 0, True, 0, 0, "", DllStructGetPtr($tStartup), DllStructGetPtr($tProcess))
    _API_CloseHandle(DllStructGetData($tProcess, "hProcess"))
    _API_CloseHandle(DllStructGetData($tProcess, "hThread" ))

    ; Close the write end of the pipe before reading from the read end of the pipe
    _API_CloseHandle($hWritePipe)

    ; Read data from the child process
    $tBuffer = DllStructCreate("char Text[4096]")
    while 1
    _API_ReadFile($hReadPipe, DllStructGetPtr($tBuffer), 4096, $iBytes)
    if $iBytes = 0 then ExitLoop
    $sData = StringLeft(DllStructGetData($tBuffer, "Text"), $iBytes)
    $sData = StringReplace($sData, @CR & @CR , @CR)
    ;~ $sData = StringReplace($sData, @CRLF & @CRLF & @CRLF , @CR)
    ;~ $sData = StringReplace($sData, @LF & @LF , @CR)
    ;~ $sData = StringReplace($sData, @TAB, @CRLF)
    ;~ $sData = StringReplace($sData, " " , "")
    GUICtrlSetData($List_1,$sData)
    ;~ ConsoleWrite($sData)
    wend
    EndFunc

    [/autoit]