Sign in to follow this  
Followers 0
SoundOfDeath

Hyperlink help needed

10 posts in this topic

#1 ·  Posted (edited)

NEW Problem!

Okay, so now I got a new problem, the hyperlinks for the list works currently I got this:

#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <ie.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Youtube Navigator", 411, 269, 632, 128)
GUISetIcon("D:\005.ico")
$PageControl1 = GUICtrlCreateTab(8, 8, 396, 256)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("Youtube Favorites")
$List1 = GUICtrlCreateList("", 16, 40, 377, 174)
GUICtrlSetData(-1, "::Emnesty:: Time to DIE montage|Ace the Best Combatarms Community Montage by Taylon & Hammudi|Banned xbox 360 Ad|Xbox Mosquito TV Commercial")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label1 = GUICtrlCreateLabel("http://www.youtube.com/user/ComplicatedKiller", 88, 232, 235, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetColor(-1, 0x0066CC)
GUICtrlSetCursor (-1, 0)
$TabSheet2 = GUICtrlCreateTabItem("Youtube Uploads")
$Label2 = GUICtrlCreateLabel("http://www.youtube.com/user/ComplicatedKiller", 88, 232, 235, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetColor(-1, 0x0066CC)
GUICtrlSetCursor (-1, 0)
$List2 = GUICtrlCreateList("", 16, 40, 377, 174)
GUICtrlSetData(-1, "")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit

           case $List1
$selected = GUICtrlRead($List1)
$selected1 = GUICtrlRead($List1)
        if $selected = "::Emnesty:: Time to DIE montage" Then
            _IECreate("http://www.youtube.com/user/ComplicatedKiller#p/a/508A4A7076651750/1/z3i3agcGwyo")
        ElseIf $selected1 = "Ace the Best Combatarms Community Montage by Taylon & Hammudi" Then
            _IECreate("http://www.youtube.com/user/ComplicatedKiller#p/a/508A4A7076651750/0/6dxwItemR-M")
        EndIf

EndSwitch

If $nMsg = $Label1 Then
    _IECreate ("http://www.youtube.com/user/ComplicatedKiller", 1, 1, 0)
EndIf

If $nMsg = $Label2 Then
    _IECreate ("http://www.youtube.com/user/ComplicatedKiller", 1, 1, 0)
EndIf


WEnd

But when I try to open the page again with clicking on the same item in the list, it doesn't respond, so I can only open the page once, does someone know how to fix this?

Edited by SoundOfDeath

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Select an item in the list and GUICtrlRead($List1) or GUICtrlRead($List2) will return which item in the list is selected.

Edit (add):

Not sure you'll be able to hyperlink them...need to get creative or leave that for one of the gurus to come up with

Edited by MrMitchell

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Nevermind give me a sec

Edited by lordicast

[Cheeky]Comment[/Cheeky]

Share this post


Link to post
Share on other sites

You can't make them actual hyperlinks, but you can style them to look like hyperlinks (alternate color blue, underlined) and then handle the event for clicking on it by launching a URL in a browser.

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Like this

#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <ie.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Youtube Navigator", 411, 269, 632, 128)
GUISetIcon("D:\005.ico")
$PageControl1 = GUICtrlCreateTab(8, 8, 396, 256)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("Youtube Favorites")
$List1 = GUICtrlCreateList("", 16, 40, 377, 174)
GUICtrlSetData(-1, "::Emnesty:: Time to DIE montage|Ace the Best Combatarms Community Montage by Taylon & Hammudi|Banned xbox 360 Ad|Xbox Mosquito TV Commercial")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label1 = GUICtrlCreateLabel("http://www.youtube.com/user/ComplicatedKiller", 88, 232, 235, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetColor(-1, 0x0066CC)
GUICtrlSetCursor (-1, 0)
$TabSheet2 = GUICtrlCreateTabItem("Youtube Uploads")
$Label2 = GUICtrlCreateLabel("http://www.youtube.com/user/ComplicatedKiller", 88, 232, 235, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetColor(-1, 0x0066CC)
GUICtrlSetCursor (-1, 0)
$List2 = GUICtrlCreateList("", 16, 40, 377, 174)
GUICtrlSetData(-1, "")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    case $List1
        $selected = GUICtrlRead($List1)
        if $selected = "::Emnesty:: Time to DIE montage" Then
            _IECreate("http://youtube.com/myvideo")
        ElseIf $selected = "Ace the Best Combatarms Community Montage by Taylon & Hammudi" Then
            _IECreate("http://youtube.com/myvideo");-- And so on
        EndIf
Case $GUI_EVENT_CLOSE
Exit

EndSwitch

If $nMsg = $Label1 Then
    _IECreate ("http://www.youtube.com/user/ComplicatedKiller", 1, 1, 0)
EndIf

If $nMsg = $Label2 Then
    _IECreate ("http://www.youtube.com/user/ComplicatedKiller", 1, 1, 0)
EndIf


WEnd

[Cheeky]Comment[/Cheeky]

Share this post


Link to post
Share on other sites

ok fixed

#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <ie.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Youtube Navigator", 411, 269, 632, 128)
GUISetIcon("D:\005.ico")
$PageControl1 = GUICtrlCreateTab(8, 8, 396, 256)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("Youtube Favorites")
$List1 = GUICtrlCreateList("", 16, 40, 377, 174)
GUICtrlSetData(-1, "::Emnesty:: Time to DIE montage|Ace the Best Combatarms Community Montage by Taylon & Hammudi|Banned xbox 360 Ad|Xbox Mosquito TV Commercial")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label1 = GUICtrlCreateLabel("http://www.youtube.com/user/ComplicatedKiller", 88, 232, 235, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetColor(-1, 0x0066CC)
GUICtrlSetCursor(-1, 0)
$TabSheet2 = GUICtrlCreateTabItem("Youtube Uploads")
$Label2 = GUICtrlCreateLabel("http://www.youtube.com/user/ComplicatedKiller", 88, 232, 235, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetColor(-1, 0x0066CC)
GUICtrlSetCursor(-1, 0)
$List2 = GUICtrlCreateList("", 16, 40, 377, 174)
GUICtrlSetData(-1, "")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    sleep(10)
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $List1
            $selected = GUICtrlRead($List1)
            If $selected = "::Emnesty:: Time to DIE montage" Then
                _IECreate("http://www.youtube.com/user/ComplicatedKiller#p/a/508A4A7076651750/1/z3i3agcGwyo",1,1,0,1)
            ElseIf $selected = "Ace the Best Combatarms Community Montage by Taylon & Hammudi" Then
                _IECreate("http://www.youtube.com/user/ComplicatedKiller#p/a/508A4A7076651750/0/6dxwItemR-M",1,1,0,1)
            EndIf

        Case $Label1
            _IECreate("http://www.youtube.com/user/ComplicatedKiller", 1, 1, 0)
        Case $Label2
            _IECreate("http://www.youtube.com/user/ComplicatedKiller", 1, 1, 0)
    EndSwitch
WEnd

[Cheeky]Comment[/Cheeky]

Share this post


Link to post
Share on other sites

Thanks lordicast, could you also help me with my new problem?

Share this post


Link to post
Share on other sites

Thanks lordicast, could you also help me with my new problem?

Thought I did? I fixed the doesnt open after 1 click problem it opens up everytime now check my last post.


[Cheeky]Comment[/Cheeky]

Share this post


Link to post
Share on other sites

Thought I did? I fixed the doesnt open after 1 click problem it opens up everytime now check my last post.

Owh i see, it works perfectly now, thanks for you help :mellow:

Share this post


Link to post
Share on other sites

Owh i see, it works perfectly now, thanks for you help :party:

No problem ... :mellow: ... :P ....


[Cheeky]Comment[/Cheeky]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0