I'm trying to make a clickable link in a GUI with the following code:
#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", 1)
$hGUI = GUICreate("Test", 300, 200)
$label = GUICtrlCreateLabel("www.autoitscript.com", 50, 80, 200, 30)
GUICtrlSetFont(-1, 16, 100, 4)
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetCursor($label,0)
GUISetOnEvent($label, "labelFun")
GUISetState()
; set loop to make GUI persistent:
While 1
sleep(100)
WEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func labelFun()
ConsoleWrite("label clicked" & @CRLF)
ShellExecute('http://www.autoitscript.com') ; open web site when clicking label
EndFunc
I don't even have a suggestion for why this doesn't work, I'm very confused! Thanks for any help offered