Bitte um Hille! Gui mit Editfelt und Ausgabe in Datei

  • Probier es mal so:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>

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

    ;Opt('MustDeclareVars', 1)

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

    Example()

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

    Func Example()
    Local $Button_1, $Button_2, $Button_3, $ProductKey, $KEY, $KEYAUSGABE, $msg, $Install_log = "D:\Recorded Data\Install_LOG\Install_Log.txt"

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

    GUICreate(" TEST", 320, 220, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1, 0x00000018); WS_EX_ACCEPTFILES
    GUICtrlCreateLabel("Produkt Key zB.: xxxxx-xxxxx-xxxxx-xxxxx-xxxxx", 10, 10)

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

    Opt("GUICoordMode", 0)
    $ProductKey = GUICtrlCreateInput("", 10, 30, 195, 20)
    $Button_1 = GUICtrlCreateButton("Start Installation", 10, 50, 120, 20)

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

    GUISetState() ; will display an dialog box with 2 button

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

    ; Run the GUI until the dialog is closed
    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
    Case $msg = $Button_1
    $file = FileOpen($Install_log, 1)
    FileWriteLine($file, "ProductKey=" & GUICtrlRead($ProductKey))
    FileClose($file)

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

    EndSelect
    WEnd
    EndFunc ;==>Example

    [/autoit]

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.