#include <IE.au3>
$oIE = _IECreate("http://autoit-script.ru/index.php/topic,16379.msg101035/topicseen.html#new",1)
$oTags = _IETagNameGetCollection($oIE, "div")
For $oTag in $oTags
If $oTag.classname == "inner" Then
$iHeight = _IEPropertyGet($oTag, "height")
MsgBox(0,"высота текста = "&$iHeight,$oTag.innertext)
ExitLoop
EndIf
Next
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include 'Marquee.au3'
Global $aMarquee
GUICreate('Marquee Example 1', 320, 220)
$aMarquee = _GUICtrlMarquee_Init()
_GUICtrlMarquee_SetScroll($aMarquee, 0, Default, 'up', 3)
_GUICtrlMarquee_SetDisplay($aMarquee, 2, 'green', Default, 18, 'comic sans ms')
_GUICtrlMarquee_Create($aMarquee, 'Up and Up...' & @CRLF & 'Up and Up...' & @CRLF & 'Up and Up...' & @CRLF & _
'Up and Up...' & @CRLF & 'Up and Up...' & @CRLF & 'Up and Up...' & @CRLF & 'Up and Up...' & @CRLF & 'Up and Up...' & @CRLF & _
'Up and Up...' & @CRLF & 'Up and Up...' & @CRLF & 'Up and Up...' & @CRLF & 'Up and Up...' & @CRLF & 'Up and Up...' & @CRLF & 'Up and Up...' _
, 10, 10, 250, 100)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
.document.write
#include<IE.au3>
;~ =================== template test.html ========================
;~ <html>
;~ <head>
;~ <style>
;~ body{
;~ border: none;
;~ margin: 0px;
;~ padding: 0px;
;~ }
;~ </style>
;~ </head>
;~ <body>
;~ </body>
;~ </html>
;~ ===============================================================
$oIE = _IECreate(@ScriptDir & '\test.html')
$oIE.document.write('Up and Up... Up and Up... Up and Up... Up and Up... Up and Up... Up and Up... Up and Up... ')
$oIE.document.body.style.margin = "0"
$oIE.document.body.style.padding = "0"
$oIE.document.body.style.fontfamily = 'Verdana, Arial, Helvetica, sans-serif'
$oIE.document.body.style.fontSize = "22px"
Local $oTextNode = _IETagNameGetCollection($oIE, 'body', 0)
MsgBox(0, '', _GetTextHeight($oIE, $oTextNode))
_IEQuit($oIE)
Func _GetTextHeight($o_Obj, $o_TextNode)
Local $i_Height = 0
Local $o_Range = $o_TextNode.createTextRange
Local $o_Rect = $o_Range.getBoundingClientRect
$i_Height = $o_Rect.bottom - $o_Rect.top
Return $i_Height
EndFunc; ==> _GetTextHeight
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include 'Marquee.au3'
Global $aMarquee
GUICreate('Marquee Example 1', 320, 220)
$aMarquee = _GUICtrlMarquee_Init()
_GUICtrlMarquee_SetScroll($aMarquee, 0, Default, 'up', 3)
_GUICtrlMarquee_SetDisplay($aMarquee, 2, 'green', Default, 18, 'comic sans ms')
_GUICtrlMarquee_Create($aMarquee, FileRead(@ScriptDir & '\test.html'), 10, 10, 250, 100)
GUISetState()
Global $oIE = $aMarquee_Params[$aMarquee][1] ; возвращаем объект, созданный _GUICtrlMarquee_Create
$oIE.document.write('Up and Up... Up and Up... Up and Up... Up and Up... Up and Up... ')
$oIE.document.body.style.margin = '0'
$oIE.document.body.style.padding = '0'
$oIE.document.body.style.fontfamily = 'Verdana, Arial, Helvetica, sans-serif'
$oIE.document.body.style.fontSize = '22px'
Local $oTextNode = _IETagNameGetCollection($oIE, 'body', 0)
MsgBox(0, '', _GetTextHeight($oIE, $oTextNode))
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _GetTextHeight($o_Obj, $o_TextNode)
Local $i_Height = 0
Local $o_Range = $o_TextNode.createTextRange
Local $o_Rect = $o_Range.getBoundingClientRect
$i_Height = $o_Rect.bottom - $o_Rect.top
Return $i_Height
EndFunc ;==>_GetTextHeight
;~ =================== template test.html ========================
;~ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
;~ <html>
;~ <head>
;~ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
;~ <title>marquee</title>
;~ <style>
;~ body{margin: 0; padding: 0;}
;~ #content{position: absolute; height: auto; visibility: hidden;}
;~ #marquee{background-color: #D4D0C8; height: 96px;}
;~ .global{margin: 0; padding: 0; width: 300px; font-family: Verdana, Arial, Helvetica, sans-serif;}
;~ </style>
;~ </head>
;~ <body scroll="no">
;~ <marquee id="marquee" class="global" behavior="scroll" direction="up"></marquee>
;~ <p id="content" class="global"></p>
;~ </body>
;~ </html>
;~ ===============================================================
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
GUICreate('Marquee Example 1', 320, 220, -1, -1)
$oIE = _IECreateEmbedded()
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 10, 300, 100)
_IENavigate ($oIE, @ScriptDir & "\test.html")
GUISetState()
$oMarquee = _IEGetObjById($oIE, 'marquee')
;~ $oMarquee.style.fontSize = '8px'
$oMarquee.style.fontSize = '33px'
$oText = _IEGetObjById($oIE, 'content')
;~ $oText.style.fontSize = '8px'
$oText.style.fontSize = '33px'
_IEPropertySet($oText, 'innerText', 'Up and Up...' & _
'Up and Up...' & _
'Up and Up...' & _
'Up and Up...' & _
'Up and Up...' & _
'Up and Up...' & _
'Up and Up...' & _
'Up and Up...' & _
'Up and Up...' & _
'Up and Up...')
_IEPropertySet($oMarquee, 'innerText', _IEPropertyGet($oText, 'innerText'))
$iHeight = $oText.clientHeight
$iWidth = $oText.clientWidth
MsgBox(0, '', $iHeight &" x "& $iWidth)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd