The capabilities of Javascript and VBScript for determining the size of an HTA at boot up to 1/4 of the screen area (half height, half width) and its center using screen.availWidth and screen.availHeight :
<SCRIPT LANGUAGE="javascript"> function Window_onLoad(){ </SCRIPT>
In VBSScript, a Window_onLoad sub is automatically called at any time when the HTA starts (or updates):
... </head> <SCRIPT LANGUAGE="VBScript"> Sub Window_onLoad ' resize to quarter of screen area, centered window.resizeTo screen.availWidth/2,screen.availHeight/2 window.moveTo screen.availWidth/4,screen.availHeight/4 End Sub </SCRIPT> <BODY> ...
I just tested it (Win XP on an old laptop) and there is a quick flicker of the initial larger window before it shrinks to a smaller size, but it's not so bad.
source share