#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 249, 72, 228, 124)
$link= GUICtrlCreateLabel("Перейти по ссылке", 16, 16, 217, 27)
GUICtrlSetFont(-1, 14, 800, 4, "Verdana")
GUICtrlSetCursor (-1, 0)
GUICtrlSetColor(-1, 0x0000FF)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $link
ShellExecute("http://autoit-script.ru")
EndSwitch
WEnd
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 333, 141, -1, -1, -1, $WS_EX_COMPOSITED)
$Label1 = GUICtrlCreateLabel("http://autoit-script.ru/", 112, 48, 106, 17)
GUICtrlSetFont(-1, 9, 300, 0)
GUICtrlSetCursor(-1, 0)
GUISetState()
While 1
$Cur = GUIGetCursorInfo()
If $Cur[4] = $Label1 Then
GUICtrlSetColor($Label1, 0x0000FF)
GUICtrlSetFont($Label1, 9, 300, 4)
Else
GUICtrlSetColor($Label1, 0x000000)
GUICtrlSetFont($Label1, 9, 300, 0)
EndIf
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Label1
ShellExecute('http://autoit-script.ru/')
EndSwitch
WEnd
А текст в каком элементе?у меня ссылка в тексте
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
MsgBox(1, 'название окна', 'Длинный текст длинный текст длинный текст длинный текст длинный текст длинный текст длинный текст длинный текст длинный текст http://ссылка.ru/ длинный текст длинный текст длинный текст длинный текст')
$hWnd=GUICreate("Окно",400,100)
;когда 1 лейбл идет первым - ссылку видно, но при нажатии на нее нажимается 1 лейбл
$hLabel1=GUICtrlCreateLabel("Длинный текст текст длинный текст длинный текст длинный текст длинный текст длинный текст ",5,10,390,80,$SS_LEFT)
;когда 2 лейбл идет первым - нет текста ссылки, но при наведении курсора на его место он меняется и если на него нажать, то срабатывает нажатие...
$hLabel2=GUICtrlCreateLabel("http://ссылка.ru/",195,10,90,15,$SS_LEFT)
GUICtrlSetCursor (-1, 0)
GUICtrlSetColor(-1, 0x0000FF)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then
ExitLoop
elseif $msg = $hLabel2 then
MsgBox(0, "", "label2")
elseif $msg = $hLabel1 then
MsgBox(0, "", "label1")
endif
WEnd
#include <WindowsConstants.au3>
#Include <ie.au3>
$Gui=GUICreate("Программа", 300,200)
If Not @compiled Then GUISetIcon(@ScriptDir&'\icon.ico')
$Viewer=GUICtrlCreateButton ("Просмотр", 130, 120,120,38)
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case $Viewer
$text_arr='<div style="background:#eeffee;"><a href="http://autoit-script.ru/index.php/topic,7122.msg49040/topicseen.html#new" target="_blank">типа ссылка</a>
<b><font color="#00A1E6">текст какой то</font></b> - текст какой то
текст какой то</div>'
_Viewer($text_arr)
Case -3
Exit
EndSwitch
WEnd
Func _Viewer($html)
Local $EditBut, $Gui1, $msg, $StrBut
GUISetState(@SW_DISABLE, $Gui)
$Gui1 = GUICreate('ага', 700, 500, -1, -1, $WS_OVERLAPPEDWINDOW, -1,$Gui)
If Not @compiled Then GUISetIcon(@ScriptDir&'\icon.ico')
$oIE=_IECreateEmbedded()
GUICtrlCreateObj($oIE, 5, 5, 690, 490)
GUICtrlSetResizing(-1, 2+4+32+64)
_IENavigate($oIE,'about:blank')
_IEDocWriteHTML($oIE, '<html><body style="background:#eeeeee;">'&$html&'</body></html>')
GUISetState(@SW_SHOW, $Gui1)
While 1
$msg = GUIGetMsg()
Select
Case $msg = -3
ExitLoop
EndSelect
WEnd
GUISetState(@SW_ENABLE, $Gui)
GUIDelete($Gui1)
EndFunc
#Include <GUIConstantsEx.au3>
#Include <WindowsConstants.au3>
Global $Form1, $Label1, $Focus, $State
$Form1 = GUICreate('autoit-script.ru', 350, 140, -1, -1, -1, $WS_EX_COMPOSITED)
$Label1 = GUICtrlCreateLabel('AutoIt forum', 135, 55, 106, 17)
GUICtrlSetColor(-1, 0x000346)
GUICtrlSetFont(-1, 11, 300, 0)
GUICtrlSetCursor(-1, 0)
GUISetState()
While 1
Sleep(20)
$State = (GUIGetCursorInfo()[4] = $Label1)
If $State Then
If Not $Focus Then
GUICtrlSetColor($Label1, 0x1968102)
GUICtrlSetFont($Label1, 11, 300, 4)
$Focus = True
ConsoleWrite('focus' & @CRLF)
EndIf
Else
If $Focus Then
GUICtrlSetColor($Label1, 0x000346)
GUICtrlSetFont($Label1, 11, 300, 0)
$Focus = False
ConsoleWrite('no focus' & @CRLF)
EndIf
EndIf
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $Label1
;ShellExecute('http://autoit-script.ru/')
ConsoleWrite('http://autoit-script.ru/' & @CRLF)
EndSwitch
WEnd