Good point, this works for me on Windows 10:
Code: Select all
words := "Cardano is a public blockchain platform. It is open-source and decentralized, with consensus achieved using proof of stake. It can facilitate peer-to-peer transactions with its internal cryptocurrency, ADA. Cardano was founded in 2015 by Ethereum co-founder Charles Hoskinson. The development of the project is overseen and supervised by the Cardano Foundation based in Zug, Switzerland. It is also the largest cryptocurrency to use a proof-of-stake blockchain, which is seen as a greener alternative to proof-of-work protocols."
f_ref := "Cardano"
Html =
(
<html><head><Style>
body {background-color: #333333; overflow: hidden}
p {font-family: 'Raleway'; font-size: 12pt; }
.words {color: #78ff78;}
.reference {color: #00ffff;}
</style></head><body>
<p class="words">%words%</p>
<p class="reference">%f_ref%</p>
</body></html>
)
Gui, +AlwaysOnTop -Caption +ToolWindow Border
gui margin, 0, 0
gui add, ActiveX, vWB w700 h0, HTMLfile
WB.write(html)
height := WB.documentElement.scrollHeight
GuiControl, Move, WB, h%height%
gui Show, AutoSize
Return
The initial height of the ActiveX control must be less that the bottom boundary of the bottommost child element (I used h0), otherwise this way won't work.
However it doesn't work on Windows 7,
height := WB.documentElement.scrollHeight is equal to the control height, whatever it is.
But after changing HTMLFILE to WebBrowser, it starts working again, although the result looks a bit different:
Code: Select all
words := "Cardano is a public blockchain platform. It is open-source and decentralized, with consensus achieved using proof of stake. It can facilitate peer-to-peer transactions with its internal cryptocurrency, ADA. Cardano was founded in 2015 by Ethereum co-founder Charles Hoskinson. The development of the project is overseen and supervised by the Cardano Foundation based in Zug, Switzerland. It is also the largest cryptocurrency to use a proof-of-stake blockchain, which is seen as a greener alternative to proof-of-work protocols."
f_ref := "Cardano"
Html =
(
<html><head><Style>
body {background-color: #333333; overflow: hidden}
p {font-family: 'Raleway'; font-size: 12pt; }
.words {color: #78ff78;}
.reference {color: #00ffff;}
</style></head><body>
<p class="words">%words%</p>
<p class="reference">%f_ref%</p>
</body></html>
)
Gui, +AlwaysOnTop -Caption +ToolWindow Border
gui margin, 0, 0
gui add, ActiveX, vWB w700 h0, about:<!DOCTYPE html><meta http-equiv="X-UA-Compatible" content="IE=edge">
WB.document.write(html)
height := WB.document.documentElement.scrollHeight
GuiControl, Move, WB, h%height%
gui Show, AutoSize
Return