Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Auto-Centering VBScript based HTA

$
0
0

Hi ScriptingGuys/All,

I am using the command below to call a custom HTA from within VBScript, and am having real difficulties getting it to launch in centre screen, rather than tucked up in one corner as it currently is!

sCommand = "mshta.exe ""javascript:{new ActiveXObject(""InternetExplorer.Application"")" _& ".putProperty('" & iRandom & "',window); window.resizeTo(" & WidthX & "," & HeightY & ");" _& "window.moveTo(" & ("screen.Width" & - WidthX) & "/2" & "," & ("screen.Height" & - HeightY) & "/2" & ")}"""

As you can see, I have the code which I THINK should be there and should work in the 'window.moveTo' statement, but this seems to be ignored completely!

('WidthX' and 'HeightY' are the two parameters passed in when calling the function, that determine the desired size of the window)

If anyone has any suggestions or can point me in the right direction, I'd be very grateful!

Many thanks,

James




Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>