Webbrowser - URL Problem

  • [autoit]


    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 462, 443, 192, 124)
    $Input1 = GUICtrlCreateInput("Input1", 16, 24, 441, 21)
    $Obj1 = ObjCreate("Shell.Explorer.2")
    $Obj1_ctrl = GUICtrlCreateObj($Obj1, 0, 64, 620, 372,)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    #cs
    sobald eine Seite aufgerufen wird soll die aktuelle url in input 1 hinen
    jedoch soll es nur einmal eingefügt werden also es darf nicht blinken!
    da man ja auch noch eine url eintippen soll!
    Ich hab das so gelöst aber es geht nicht:
    $url1 = _IEPropertyGet($Obj3, "locationurl")
    GUICtrlSetData($Input1, $url1)
    If Not GUICtrlRead($Input1) = $url1 Then GUICtrlSetData($Input1, $url1)
    #ce

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

    EndSwitch
    WEnd

    [/autoit]
  • Du hast übrigens $Obj3 verwendet, die Variable hast du garnicht.

    Versuchs mal so:

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <IE.au3>

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

    Global $sTitle, $sUrl

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

    $hGui = GUICreate("Form1", 625, 443, 192, 124)
    $hTitle = GUICtrlCreateButton("Titel", 8, 32, 75, 25)
    $hAddress = GUICtrlCreateInput("", 100, 32, 300, 20)
    $hGo = GUICtrlCreateButton("Go", 420, 30, 50, 25)
    $oIE = _IECreateEmbedded()
    $hIE = GUICtrlCreateObj($oIE, 0, 64, 620, 372)
    GUISetState()

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

    While 1
    If _IEPropertyGet($oIE, "locationurl") <> $sUrl Then
    $sUrl = _IEPropertyGet($oIE, "locationurl")
    GUICtrlSetData($hAddress, $sUrl)
    $sTitle = _IEPropertyGet($oIE, "title")
    GUICtrlSetData($hTitle, $sTitle)
    WinSetTitle($hGui, "", $sTitle)
    EndIf

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

    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    Exit
    Case $hGo
    _IENavigate($oIE, GUICtrlRead($hAddress))
    EndSwitch
    WEnd

    [/autoit]
  • hmm... ein Deja vu :P

    das löst du genauso wie dein Webbrowser - Titel Problem
    [ gelöst ] Webbrowser - Titel Problem ;)

    Spoiler anzeigen
    [autoit]


    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <IE.au3>

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

    #Region ### START Koda GUI section ### Form=
    $url1 = ""
    $Input1Title = "Input1"
    $Form1 = GUICreate("Form1", 462, 443, 192, 124)
    $Input1 = GUICtrlCreateInput($Input1Title, 16, 24, 441, 21)
    $Obj1 = ObjCreate("Shell.Explorer.2")
    $Obj1_ctrl = GUICtrlCreateObj($Obj1, 0, 64, 620, 372)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    _IENavigate($Obj1, "www.google.de", 0) ; nur zum testen eingefügt

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case Else
    $url1 = _IEPropertyGet($Obj1, "locationurl")
    If Not ($Input1Title = $url1) Then
    $Input1Title = $url1
    GUICtrlSetData($Input1, $Input1Title)
    EndIf
    EndSwitch
    WEnd

    [/autoit]