I have a HTA that is set as the logon script for my domain. The first
thing the HTA does is resize and position its window (this is done as
part of the body onload event). When the HTA runs, a large, blank,
white window quickly flashes up before its resized.
Is there a way to set the initial size and position of the HTA before
it is rendered to avoid the messy flashing big window?
Thanks for any help.
Mick.
I run a normal vbs as the logon script. This then I use IE for output. This
way you can control the looks of it all better and if the user closes the ie
window it doesn't matter. You can just open it agan. :)
If you get input from the user through your hta this might not work...
Below are some of the my "functions".
Hope this helps! :)
/Sofia
------------------------------------------------------------------------------------------------------------------------
Dim objIE : Set objIE = CreateObject("InternetExplorer.Application")
Function IEOpen() '2005-01-14, 2005-01-24
objIE.Navigate "about:blank"
objIE.StatusBar = 0 : objIE.ToolBar = 0
objIE.Fullscreen = 1 : objIE.Visible = 1
objIE.Document.Title = "Logon Script"
objIE.Document.Body.Style.Backgroundcolor = "#111111"
'objIE.Document.Body.Style.BackgroundImage = ""
objIE.Document.Body.Text = "#DDDDDD"
objIE.Document.Body.Style.Font = "12pt 'Verdana'"
objIE.Document.Body.Style.BorderWidth = "10px"
objIE.Document.Body.Scroll = "Auto"
End Function
Function IEActivate() '2005-01-24
On Error Resume Next 'Disable Error handling in case the IE window was
already closed
SYS_objShell.AppActivate "Logon Script"
On Error Goto 0
End Function
Function IEClose() '2005-01-14, 2005-01-24
On Error Resume Next 'Disable Error handling in case the IE window was
already closed
objIE.Quit
On Error Goto 0
End Function
Function Font(intSize,strColor) '2005-01-17, 2005-01-24
If Len(strColor)<>7 Then strColor = "#DDDDDD"
WriteStd("</FONT><FONT size="+CStr(intSize)+" color="+strColor+">")
End Function
Function WriteStd(strMessage) '2005-01-17, 2005-01-24, 2005-02-07
strOutStd = strOutStd + strMessage
On Error Resume Next 'Disable Errorhandling in case the IE window was
already closed
objIE.Document.Body.InnerHTML = strOutStd
If Err.Number <> 0 Then 'If the user has closed the IE Window, open it
again.
Set objIE = CreateObject("InternetExplorer.Application")
IEOpen()
IEActivate()
objIE.Document.Body.InnerHTML = strOutStd
End If
On Error Goto 0
End Function
'Text is overwritten next time text is added
Function WriteStdTemp(strMessage) '2005-01-17
On Error Resume Next 'Disable Errorhandling in case the IE window was
already closed
objIE.Document.Body.InnerHTML = objIE.Document.Body.InnerHTML + strMessage
If Err.Number <> 0 Then 'If the user has closed the IE Window, open it
again.
Set objIE = CreateObject("InternetExplorer.Application")
IEOpen()
IEActivate()
objIE.Document.Body.InnerHTML = strOutStd + strMessage
End If
On Error Goto 0
End Function
------------------------------------------------------------------------------------------------------------------------
<mickb...@gmail.com> wrote in message
news:1157349079....@p79g2000cwp.googlegroups.com...
--
Joe Fawcett (MVP)
<mickb...@gmail.com> wrote in message
news:1157349079....@p79g2000cwp.googlegroups.com...
Joe - I have tried the resize code in both the window and body onLoad
events but the problem persists.
DhamAngry - Hopefully someone will reply with a solution for us!
--
Joe
"DhamAngry" <Dham...@discussions.microsoft.com> wrote in message
news:DDD1582F-3EEE-49EA...@microsoft.com...
Note the location of the resizing script *above* the hta:application tag.
Positioned here, you won't see the window in it's original default size.
<html>
<head>
<title>My HTA Title</title>
<script language="vbscript">
moveto 250,100
resizeto 500,320
</script>
<hta:application
...
...
/>
...
..
.
</head>
--
Michael Harris
Microsoft MVP Scripting