"Go" Button mit Liste verknüpfen

  • Hallo Members

    Ich habe ein "Go" Button im Script eingebaut, jetzt wollte ich wenn man in der Liste auf Googel klickt und dann auf dem "Go" Button, das man dann weitergeleitet wird mit der Funktion shellExecute zur https://autoit.de/www.googel.de

    Genau das gleiche sollte auch mit Youtube in der Liste passieren, dass man halt dementsprechend zu https://autoit.de/www.youtube.com weitergeleitet wird wenn man auf dem "Go" Button klickt

    Es soll aber auch nur ein "Go" Button sein der die einzelnen Webseiten eintrage in der Liste weiterleitet

    Danke schon mal im voraus

    Hier das Script :)

    Spoiler anzeigen
    [autoit]

    Global $a_Inhalt[9][3] = [ _
    ["Google", "Inhalt #1", "List3 #1"], _
    ["Youtube", "Inhalt #2", "List3 #2"], _
    [3, "Inhalt #3", "List3 #3"], _
    [4, "Inhalt #4", "List3 #4"], _
    [5, "Inhalt #5", "List3 #5"], _
    [6, "Inhalt #6", "List3 #6"], _
    [7, "Inhalt #7", "List3 #7"], _
    [8, "Inhalt #8", "List3 #8"], _
    [9, "Inhalt #9", "List3 #9"]]

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

    $h_Gui = GUICreate ("", 650, 250)
    $h_List1 = GUICtrlCreateList ("", 10, 10, 160, 160)
    $h_List2 = GUICtrlCreateList ("", 180, 10, 160, 160)
    $h_List3 = GUICtrlCreateList ("", 350, 10, 160, 160)

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

    For $i = 0 To UBound ($a_Inhalt) - 1
    GUICtrlSetData ($h_List1, $a_Inhalt[$i][0])
    Next

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

    GUISetState (@SW_SHOW, $h_Gui)

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

    $go = GUICtrlCreateButton("Go", 10, 200, 50, 26)

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

    GUISetState(@SW_SHOW)

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

    While True
    Switch GUIGetMsg ()
    Case -3
    Exit
    Case $h_List1
    $s_Read = GUICtrlRead ($h_List1)
    For $i = 0 To UBound ($a_Inhalt) - 1
    If $s_Read = $a_Inhalt[$i][0] Then
    GUICtrlSetData ($h_List2, "")
    GUICtrlSetData ($h_List2, $a_Inhalt[$i][1])
    GUICtrlSetData ($h_List3, "")
    GUICtrlSetData ($h_List3, $a_Inhalt[$i][2])
    ExitLoop
    EndIf
    Next

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

    EndSwitch
    WEnd

    [/autoit]


    mfg Mainstream

    Einmal editiert, zuletzt von Mainstream (4. Juni 2012 um 23:42)

  • Der Code kommt mir doch irgendwie bekannt vor... <_<"

    Spoiler anzeigen
    [autoit]

    Global $a_Inhalt[9][4] = [ _
    ["Google", "Inhalt #1", "List3 #1", "www.google.de"], _
    ["Youtube", "Inhalt #2", "List3 #2", "www.youtube.com"], _
    [3, "Inhalt #3", "List3 #3"], _
    [4, "Inhalt #4", "List3 #4"], _
    [5, "Inhalt #5", "List3 #5"], _
    [6, "Inhalt #6", "List3 #6"], _
    [7, "Inhalt #7", "List3 #7"], _
    [8, "Inhalt #8", "List3 #8"], _
    [9, "Inhalt #9", "List3 #9"]]

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

    $h_Gui = GUICreate ("", 650, 250)
    $h_List1 = GUICtrlCreateList ("", 10, 10, 160, 160)
    $h_List2 = GUICtrlCreateList ("", 180, 10, 160, 160)
    $h_List3 = GUICtrlCreateList ("", 350, 10, 160, 160)

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

    For $i = 0 To UBound ($a_Inhalt) - 1
    GUICtrlSetData ($h_List1, $a_Inhalt[$i][0])
    Next

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

    $h_Go = GUICtrlCreateButton("Go", 10, 200, 50, 26)

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

    GUISetState (@SW_SHOW, $h_Gui)

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

    While True
    Switch GUIGetMsg ()
    Case -3
    Exit
    Case $h_List1
    $s_Read = GUICtrlRead ($h_List1)
    For $i = 0 To UBound ($a_Inhalt) - 1
    If $s_Read = $a_Inhalt[$i][0] Then
    GUICtrlSetData ($h_List2, "")
    GUICtrlSetData ($h_List2, $a_Inhalt[$i][1])
    GUICtrlSetData ($h_List3, "")
    GUICtrlSetData ($h_List3, $a_Inhalt[$i][2])
    ExitLoop
    EndIf
    Next
    Case $h_Go
    $s_Read = GUICtrlRead ($h_List1)
    For $i = 0 To UBound ($a_Inhalt) - 1
    If $s_Read = $a_Inhalt[$i][0] Then ExitLoop ShellExecute ($a_Inhalt[$i][3])
    Next
    EndSwitch
    WEnd

    [/autoit]
  • Danke $var du bist der beste und natürlich kommt der Code dir bekannt vor... ist ja auch von DIR :)

    Ohne dich wären mir schon bei einigen codes die Haare ausgefallen, was ich gut finde... du bist auch zu Anfängern sehr hilfsbereit ohne sie gleich bloßzustellen, so wie manch andere hier im Board

    mfg Mainstream