Robin Posted April 5, 2009 Share Posted April 5, 2009 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 More sharing options...
KaFu Posted April 5, 2009 Share Posted April 5, 2009 #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 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Malkey Posted April 5, 2009 Share Posted April 5, 2009 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. expandcollapse popup; #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 More sharing options...
Robin Posted April 5, 2009 Author Share Posted April 5, 2009 #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 EndFuncThanks KaFu...seems like this is a winner Link to comment Share on other sites More sharing options...
Robin Posted April 5, 2009 Author Share Posted April 5, 2009 And another example. expandcollapse popup; #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 Link to comment Share on other sites More sharing options...
trancexx Posted April 5, 2009 Share Posted April 5, 2009 You could change color of links onmouseover. Maybe like this:expandcollapse popup; #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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now