Keeping an HTA from resizing to extremely small sizes

会有一股神秘感。 提交于 2019-12-12 03:26:04

问题


I have a HTA that I want to block resizing to extremely small sizes (less than 170x70). I found a way in VBScript to do this by detecting if the window is to small and if it is resizing it automatically like this:

<script type="text/vbscript">
     Sub Window_onResize
          Dim w
          Dim h
          Dim p
          w = Document.Body.OffsetWidth
          h = Document.Body.OffsetHeight
          p = false
          If Document.Body.OffsetWidth < 170 Then
               w = 170
               p = true
          End If
          If Document.Body.OffsetHeight < 70 Then
               h = 70
               p = true
          End If
          If p Then
               window.ResizeTo w,h
          End If
     End Sub
</script>

My problem is that apparently ResizeTo counts the scroll bar and the title bar whereas OffsetWidth and OffsetHeight don't. I thought of solving this problem by detecting the title bar's height and the scroll bar's width. I've searched the web for how to do this and I haven't found anything. You can suggest a way of detecting the title bar's height and the scroll bar's width or another way of keeping the HTA from getting resized to extremesly small sizes.

来源:https://stackoverflow.com/questions/28114310/keeping-an-hta-from-resizing-to-extremely-small-sizes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!