Wie ein Label bzw. Progress einer externen Anwendung auslesen?

  • Also, ich habe angefangen mich mit dem Fernsteuern von Programmen zu beschäftigen.
    Erstes Programm wäre RegClean von Microsoft. Es gibt dort ein Label (Static7 heißt es), dass ich in einer Schleife auslesen will: Also

    [autoit]

    Do
    ;Halligalli
    Until ;Static 7 = Fix Errors o.ä.

    [/autoit]

    Und wie kann ich den Fortschritt eines Progresses dessen Namen ich kenne auslesen?

    Danke für alle Antworten! ;)

    Einmal editiert, zuletzt von MatthiasG. (14. Februar 2009 um 17:39)

  • Aber mit den Windows Dlls gehts bestimmt. Irgendwie :)

    Un wie genau? ^^

    Das LAbel hab ich jetzt, aber was ist mit der Progressbar?

    Einmal editiert, zuletzt von MatthiasG. (14. Februar 2009 um 10:47)

  • Danke! Ich habe es beim Microsoft Windows Tool zum entfernen bösartiger Software ausprobiert, aber iwie funzt das nicht:

    "Skript"
    [autoit]

    #RequireAdmin
    #include <WindowsConstants.au3>
    #include <ProgressConstants.au3>
    #include <SendMessage.au3>

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

    $ProgressGUI = GUICreate("Form1", 545, 25, -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW)
    $Progress = GUICtrlCreateProgress(0, 0, 545, 25)
    GUISetState(@SW_SHOW)

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

    $Risiko = 3

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

    Run(@ScriptDir & "\Tools\windows-kb890830-v2.6.exe")

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

    WinWait("Microsoft Windows-Tool zum Entfernen bösartiger Software - JAN 2009 ")
    Sleep(1000)

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

    ControlClick("Microsoft Windows-Tool zum Entfernen bösartiger Software - JAN 2009 ", "", 12324)

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

    If $Risiko < 3 Then
    ControlClick("Microsoft Windows-Tool zum Entfernen bösartiger Software - JAN 2009 ", "", 1034)
    Else
    ControlClick("Microsoft Windows-Tool zum Entfernen bösartiger Software - JAN 2009 ", "", 1033)
    EndIf

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

    ControlClick("Microsoft Windows-Tool zum Entfernen bösartiger Software - JAN 2009 ", "", 12324)

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

    $ProgressHandle = ControlGetHandle("Microsoft Windows-Tool zum Entfernen bösartiger Software - JAN 2009 ","","msctls_progress321") ; Handle zur 1. Progressbar des Fensters "Fenstertitel" holen

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

    Do
    $progressbarPOS = _SendMessage($ProgressHandle,$PBM_GETPOS) ; mit dem Handle kann dann mit _SendMessage die Position abgefragt werden.
    GUICtrlSetData($Progress, $progressbarPOS)
    Sleep(100)
    MsgBox(0, "", $progressbarPOS)
    Until $progressbarPOS = 100

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

    Sleep(10000)

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

    MsgBox(0, "", "Fertig")

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

    ;ControlClick("Microsoft Windows-Tool zum Entfernen bösartiger Software - JAN 2009 ", "", 12325)

    [/autoit]
  • Die echte Progressbar kann auch mit anderen Werten also von 0-100 verwendet werden. Das muss man erst umrechnen:

    Spoiler anzeigen
    [autoit]

    #RequireAdmin
    #include <WindowsConstants.au3>
    #include <ProgressConstants.au3>
    #include <SendMessage.au3>

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

    $ProgressGUI = GUICreate("Form1", 545, 25, -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW)
    $Progress = GUICtrlCreateProgress(0, 0, 545, 25)
    GUISetState(@SW_SHOW)

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

    $ProgressHandle = ControlGetHandle("Microsoft Windows-Tool zum Entfernen bösartiger Software","","msctls_progress321") ; Handle zur 1. Progressbar des Fensters "Fenstertitel" holen
    $LowLimit = _SendMessage($ProgressHandle,$PBM_GETRANGE,True)
    $HighLimit = _SendMessage($ProgressHandle,$PBM_GETRANGE,False)

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

    Do
    $progressbarPOS = _SendMessage($ProgressHandle,$PBM_GETPOS) ; mit dem Handle kann dann mit _SendMessage die Position abgefragt werden.
    $prozent = ($progressbarPOS-$LowLimit)/($HighLimit-$LowLimit)*100
    GUICtrlSetData($Progress, $prozent)
    Sleep(100)
    ;~ MsgBox(0, "", $progressbarPOS)
    Until $prozent = 100

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

    Sleep(10000)

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

    MsgBox(0, "", "Fertig")

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

    ;ControlClick("Microsoft Windows-Tool zu

    [/autoit]