Fenstername anhand von Prozess rausfinden

  • Huhu
    Ich möchte mir ein kleines Programm erstellen was bestimmte Datein in einem bestimmten Zeitabstand abspeichert. Bis jetzt sieht das ganze so aus:

    Spoiler anzeigen
    [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Process.au3>
    #Region ### START Koda GUI section ### Form=
    $Form = GUICreate("Autosave", 500, 206, 192, 124)
    $cProzess = GUICtrlCreateCombo("", 32, 80, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
    $Zeit = GUICtrlCreateInput("", 272, 80, 121, 21)
    $Label1 = GUICtrlCreateLabel("Prozess auswählen", 48, 40, 116, 17)
    $Label2 = GUICtrlCreateLabel("Zeitabstand zwischen save in s", 280, 32, 108, 25)
    $start = GUICtrlCreateButton("Start", 176, 144, 113, 25)
    $list = ProcessList()
    for $i = 1 to $list[0][0]
    GuiCtrlSetData($cProzess,$list[$i][0])
    next
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $start
    _start()
    EndSwitch
    WEnd

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

    Func _start()
    $read = GuiCtrlRead($cProzess)
    $name = _ProcessGetName($read)
    MsgBox(0,"",$name)
    EndFunc

    [/autoit]

    Der Benutzer wählt den Prozess aus und dann soll der Fenstername des Prozesses rausgefunden werden, um dann später per ControlSend STRG+S für speichern zu senden. Doch ich scheitere an dem Fensternamen X(

    Wisst ihr da was?

    Grüße

  • [autoit]

    Func _ProcGetWin($vPID)
    $vWinList = WinList("")
    For $i = 1 To $vWinList[0][0]
    If WinGetProcess($vWinList[$i][1]) = $vPID Then Return $vWinList[$i][1]
    Next
    EndFunc

    [/autoit]


    Funktioniert allerdings nur solange es nur ein Fenster pro Prozess gibt, da sonst immer nur das erste im Array returned wird.

  • Schau dir mal diesen Post hier an:
    https://autoit.de/index.php?page…42581#post42581

    MfG
    Nestos.

    Zitat

    [Heute, 11:39] Raupi: Soll ich es dir machen?
    [Heute, 11:47] BugFix: "Soll ich es dir machen? " - also Raupi !! bitte nicht so öffentlich :rofl:

    Zitat

    [Heute, 11:51] BugFix: und ich werde es mir jetzt machen - das Mittagessen :P

    AMsg UDF v1.00.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%
    OwnStyle UDF Version 1.10.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%