HTA 应用程序:将 window 放在屏幕的右下角

HTA application: Place window at the bottom-right of the screen

我正在尝试将我的 hta 应用程序 window 移动到桌面(屏幕)的右下角。如果我放置静态值,那么它可以工作,但我想将 window 放在每个屏幕分辨率的右下角。我不知道如何对 .hta "place the window 50% from the top border and 5% from the right border" 说。这是我的小脚本:

<script language="VBScript">
   'On Error Resume Next
   window.resizeTo 450, 400
   var monitorHeight = screen.Height;
   var monitorWidth = screen.Width; 

    window.moveTo monitorWidth-450, monitorHeight-400



    window.moveTo WindowLeft,WindowTop 

</script>

我可以居中 window:

<script language="VBScript">
  'On Error Resume Next   
  window.resizeTo 450, 400
window.moveTo (screen.width -450) / 2, (screen.height-400) / 2
</script>

但是不能把window放在右下角。

你可以尝试类似的方法:

<script language="VBScript">
    window.resizeTo 450,400
    WindowLeft = (window.screen.availWidth - 450)  
    WindowTop  = (window.screen.availHeight - 400)
    window.moveTo WindowLeft, WindowTop
</script>