Jump to content

Another hyperlink question


Recommended Posts

Ok...I have tried the hyperlink au3 here ---> http://www.autoitscript.com/forum/index.ph...mp;hl=hyperlink,

but got random errors...Is there a way where i can actually make a Label to "act" as a command? I know how the hyperlink functions with the shellexecute command, but i need to have the hyperlink shown as a label, then, once clicking on it, it must take me to a url...thx once more guys...

Link to comment
Share on other sites

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

GUICreate("My GUI"); will create a dialog box that when displayed is centered

$c_Hyperlink_FunkEu = GUICtrlCreateLabel("http://www.funk.eu", 20,20)
GUICtrlSetFont(-1, 8, 400, 4, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetCursor(-1, 0)
GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")
GUISetState(@SW_SHOW); will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    
WEnd
GUIDelete()

Func MY_WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $iIDFrom = BitAND($wParam, 0xFFFF);LoWord
    Switch $iIDFrom
        Case $c_Hyperlink_FunkEu
            ShellExecute("http://www.funk.eu")
    EndSwitch
EndFunc

Link to comment
Share on other sites

Ok...I have tried the hyperlink au3 here ---> http://www.autoitscript.com/forum/index.ph...mp;hl=hyperlink,

but got random errors...Is there a way where i can actually make a Label to "act" as a command? I know how the hyperlink functions with the shellexecute command, but i need to have the hyperlink shown as a label, then, once clicking on it, it must take me to a url...thx once more guys...

And another example.

;
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$hGUI = GUICreate("Links", 200, 215, @DesktopWidth - 270, @DesktopHeight - 280, $WS_OVERLAPPEDWINDOW, $WS_EX_TOPMOST)
GUISetBkColor(0xBBBBFF, $hGUI)

$LabInterpol = GUICtrlCreateLabel("Interpolation Mode", 20, 35, 120, 20)
GUICtrlSetColor($LabInterpol, 0x0000FF)
GUICtrlSetFont($LabInterpol, 9, 800, 4)
GUICtrlSetTip($LabInterpol, "   Link about InterpolationMode  at" & @CRLF & _
        " http://msdn2.microsoft.com/en-us/library/ms534141(VS.85).aspx)")

$LabPixOff = GUICtrlCreateLabel("Pixel Offset Mode", 20, 60, 100, 20)
GUICtrlSetColor($LabPixOff, 0x0000FF)
GUICtrlSetFont($LabPixOff, 9, 800, 4)
GUICtrlSetTip($LabPixOff, "   Link about PixelOffsetMode at" & @CRLF & _
        " http://msdn2.microsoft.com/en-us/library/ms534169(VS.85).aspx)")

$LabSmooth = GUICtrlCreateLabel("Smoothing Mode", 20, 85, 100, 20)
GUICtrlSetColor($LabSmooth, 0x0000FF)
GUICtrlSetFont($LabSmooth, 9, 800, 4)
GUICtrlSetTip($LabSmooth, "   Link about SmoothingMode at" & @CRLF & _
        " http://msdn2.microsoft.com/en-us/library/ms534173(VS.85).aspx")

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $LabInterpol
            ShellExecute("http://msdn2.microsoft.com/en-us/library/ms534141(VS.85).aspx")
        Case $LabPixOff
            ShellExecute("http://msdn2.microsoft.com/en-us/library/ms534173(VS.85).aspx")
        Case $LabSmooth
            ShellExecute("http://msdn2.microsoft.com/en-us/library/ms534173(VS.85).aspx")
    EndSwitch
WEnd
;
Link to comment
Share on other sites

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

GUICreate("My GUI"); will create a dialog box that when displayed is centered

$c_Hyperlink_FunkEu = GUICtrlCreateLabel("http://www.funk.eu", 20,20)
GUICtrlSetFont(-1, 8, 400, 4, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetCursor(-1, 0)
GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")
GUISetState(@SW_SHOW); will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    
WEnd
GUIDelete()

Func MY_WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $iIDFrom = BitAND($wParam, 0xFFFF);LoWord
    Switch $iIDFrom
        Case $c_Hyperlink_FunkEu
            ShellExecute("http://www.funk.eu")
    EndSwitch
EndFunc
Thanks KaFu...seems like this is a winner :D
Link to comment
Share on other sites

And another example.

;
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$hGUI = GUICreate("Links", 200, 215, @DesktopWidth - 270, @DesktopHeight - 280, $WS_OVERLAPPEDWINDOW, $WS_EX_TOPMOST)
GUISetBkColor(0xBBBBFF, $hGUI)

$LabInterpol = GUICtrlCreateLabel("Interpolation Mode", 20, 35, 120, 20)
GUICtrlSetColor($LabInterpol, 0x0000FF)
GUICtrlSetFont($LabInterpol, 9, 800, 4)
GUICtrlSetTip($LabInterpol, "   Link about InterpolationMode  at" & @CRLF & _
        " http://msdn2.microsoft.com/en-us/library/ms534141(VS.85).aspx)")

$LabPixOff = GUICtrlCreateLabel("Pixel Offset Mode", 20, 60, 100, 20)
GUICtrlSetColor($LabPixOff, 0x0000FF)
GUICtrlSetFont($LabPixOff, 9, 800, 4)
GUICtrlSetTip($LabPixOff, "   Link about PixelOffsetMode at" & @CRLF & _
        " http://msdn2.microsoft.com/en-us/library/ms534169(VS.85).aspx)")

$LabSmooth = GUICtrlCreateLabel("Smoothing Mode", 20, 85, 100, 20)
GUICtrlSetColor($LabSmooth, 0x0000FF)
GUICtrlSetFont($LabSmooth, 9, 800, 4)
GUICtrlSetTip($LabSmooth, "   Link about SmoothingMode at" & @CRLF & _
        " http://msdn2.microsoft.com/en-us/library/ms534173(VS.85).aspx")

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $LabInterpol
            ShellExecute("http://msdn2.microsoft.com/en-us/library/ms534141(VS.85).aspx")
        Case $LabPixOff
            ShellExecute("http://msdn2.microsoft.com/en-us/library/ms534173(VS.85).aspx")
        Case $LabSmooth
            ShellExecute("http://msdn2.microsoft.com/en-us/library/ms534173(VS.85).aspx")
    EndSwitch
WEnd
;
thanks Malkey...i like your setup here with the fonts etc :D
Link to comment
Share on other sites

You could change color of links onmouseover. Maybe like this:

;
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$hGUI = GUICreate("Links", 200, 215, @DesktopWidth - 270, @DesktopHeight - 280, $WS_OVERLAPPEDWINDOW, $WS_EX_TOPMOST)
GUISetBkColor(0xBBBBFF, $hGUI)

$LabInterpol = GUICtrlCreateLabel("Interpolation Mode", 20, 35, 120, 20)
GUICtrlSetColor($LabInterpol, 0x0000FF)
GUICtrlSetFont($LabInterpol, 9, 800, 4)
GUICtrlSetCursor($LabInterpol, 0)
GUICtrlSetTip($LabInterpol, "   Link about InterpolationMode  at" & @CRLF & _
        " http://msdn2.microsoft.com/en-us/library/m...85).aspx)")

$LabPixOff = GUICtrlCreateLabel("Pixel Offset Mode", 20, 60, 100, 20)
GUICtrlSetColor($LabPixOff, 0x0000FF)
GUICtrlSetFont($LabPixOff, 9, 800, 4)
GUICtrlSetCursor($LabPixOff, 0)
GUICtrlSetTip($LabPixOff, "   Link about PixelOffsetMode at" & @CRLF & _
        " http://msdn2.microsoft.com/en-us/library/m...85).aspx)")

$LabSmooth = GUICtrlCreateLabel("Smoothing Mode", 20, 85, 100, 20)
GUICtrlSetColor($LabSmooth, 0x0000FF)
GUICtrlSetFont($LabSmooth, 9, 800, 4)
GUICtrlSetCursor($LabSmooth, 0)
GUICtrlSetTip($LabSmooth, "   Link about SmoothingMode at" & @CRLF & _
        " http://msdn2.microsoft.com/en-us/library/m....85).aspx")

GUISetState()
$iBlue = 1

While 1
    
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $LabInterpol
            ShellExecute("http://msdn2.microsoft.com/en-us/library/ms534141(VS.85).aspx")
        Case $LabPixOff
            ShellExecute("http://msdn2.microsoft.com/en-us/library/ms534173(VS.85).aspx")
        Case $LabSmooth
            ShellExecute("http://msdn2.microsoft.com/en-us/library/ms534173(VS.85).aspx")
    EndSwitch

    $aCursorInfo = GUIGetCursorInfo()
    If Not @error Then  
        Switch $aCursorInfo[4]
            Case $LabInterpol
                If $iBlue Then
                    GUICtrlSetColor($LabInterpol, 0xFF0000)
                    $iBlue = 0
                EndIf
            Case $LabPixOff
                If $iBlue Then
                    GUICtrlSetColor($LabPixOff, 0xFF0000)
                    $iBlue = 0
                EndIf
            Case $LabSmooth
                If $iBlue Then
                    GUICtrlSetColor($LabSmooth, 0xFF0000)
                    $iBlue = 0
                EndIf
            Case Else
                If Not $iBlue Then
                    GUICtrlSetColor($LabInterpol, 0x0000FF)
                    GUICtrlSetColor($LabPixOff, 0x0000FF)
                    GUICtrlSetColor($LabSmooth, 0x0000FF)
                    $iBlue = 1
                EndIf
        EndSwitch
    EndIf

WEnd

♡♡♡

.

eMyvnE

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...