send($Variable)

  • Hi Leute habe das Problem das ,wenn ich eine Variable per Inputbox defeniere und dann die Variable mit dem send befehl ausgebe (in notepad rein),das dann dort 3 steht obwohl ich f eingebe!!

    [autoit]


    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Form1", 405, 294, 302, 218)
    $Input1 = GUICtrlCreateInput("Input1", 72, 64, 217, 21)
    $Button1 = GUICtrlCreateButton("Button1", 144, 208, 105, 65, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    case $Button1
    run("notepad")
    sleep(1000)
    send($Input1)
    EndSwitch
    WEnd

    [/autoit]

    Einmal editiert, zuletzt von JoNbOyX (26. Oktober 2010 um 17:35)

  • Du musst vorher $input auslesen mit GUICtrlRead(), da du sonst nur den Identifier zurück gibst!

    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Form1", 405, 294, 302, 218)
    $Input1 = GUICtrlCreateInput("Input1", 72, 64, 217, 21)
    $Button1 = GUICtrlCreateButton("Button1", 144, 208, 105, 65, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    case $Button1
    run("notepad")
    sleep(1000)
    send(GUICtrlRead($Input1))
    EndSwitch
    WEnd

    [/autoit]

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • "$Input1" enthält nur die ID von "GUICtrlCreateInput"
    Mit Guictrlread wird das Control dann ausgelesen:

    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Form1", 405, 294, 302, 218)
    $Input1 = GUICtrlCreateInput("Input1", 72, 64, 217, 21)
    $Button1 = GUICtrlCreateButton("Button1", 144, 208, 105, 65, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    case $Button1
    run("notepad")
    sleep(1000)
    send(Guictrlread($Input1) )
    EndSwitch
    WEnd

    [/autoit]

    edit \ da war jemand schneller :thumbup: