Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Is it possible to allow the use of the status bar via script, using a vbscript?

Reply
 
Old 07-27-2008   #1 (permalink)
Joseph


 
 

Is it possible to allow the use of the status bar via script, using a vbscript?

Hi everyone,

Is it possible to allow the use of the status bar via script, using a
vbscript?

I have a script that deletes files in the temp folders and in IE 6 it would
use the status bar to display its progress.
Not so with IE7 which for "security" reasons prevents the status bar from
displaying anything unless the setting is changed in Tools -> Internet
Options, etc.
Does anyone know the registry key to modify for that?

Thanks in advance for your help.

Joseph


My System SpecsSystem Spec
Old 07-28-2008   #2 (permalink)
Sam Hobbs


 
 

Re: Is it possible to allow the use of the status bar via script, using a vbscript?

Don't modify the registry directly when there is a documented solution and
this is something that Microsoft would provide a documented solution for.

Speaking of documentation .... guess what?


"Joseph" <josephoget@xxxxxx> wrote in message
news:51FC3BBA-E818-42F8-AAE5-217E247707F4@xxxxxx
Quote:

> Hi everyone,
>
> Is it possible to allow the use of the status bar via script, using a
> vbscript?
>
> I have a script that deletes files in the temp folders and in IE 6 it
> would use the status bar to display its progress.
> Not so with IE7 which for "security" reasons prevents the status bar from
> displaying anything unless the setting is changed in Tools -> Internet
> Options, etc.
> Does anyone know the registry key to modify for that?
>
> Thanks in advance for your help.
>
> Joseph
>


My System SpecsSystem Spec
Old 07-28-2008   #3 (permalink)
mayayana


 
 

Re: Is it possible to allow the use of the status bar via script, using a vbscript?

The status bar may not be the best choice, but if that's
what you really want, see here:

http://support.microsoft.com/kb/182569

It looks like the value is probably 2103 set to 1.
With "Local Machine Lockdown" possible you actually
need to set the value in 4 places if you want to be
sure it's not being overridden by some other hidden
setting.

Where "***" = "Software\Microsoft\Windows\CurrentVersion\Internet Settings"

you would want to set the following:

HKLM\***\Zones\0\2103
HKCU\***\Zones\0\2103
HKLM\***\Lockdown_Zones\0\2103
HKCU\***\Lockdown_Zones\0\2103


Quote:

>
> Is it possible to allow the use of the status bar via script, using a
> vbscript?
>
> I have a script that deletes files in the temp folders and in IE 6 it
would
Quote:

> use the status bar to display its progress.
> Not so with IE7 which for "security" reasons prevents the status bar from
> displaying anything unless the setting is changed in Tools -> Internet
> Options, etc.
> Does anyone know the registry key to modify for that?
>
> Thanks in advance for your help.
>
> Joseph
>

My System SpecsSystem Spec
Old 07-28-2008   #4 (permalink)
Old Pedant


 
 

RE: Is it possible to allow the use of the status bar via script, usin

"Joseph" wrote:
Quote:

> I have a script that deletes files in the temp folders and in IE 6 it would
> use the status bar to display its progress.
> Not so with IE7 which for "security" reasons prevents the status bar from
> displaying anything unless the setting is changed in Tools -> Internet
> Options, etc.
Not to ask a dumb question, but...

Why not display the status in a <DIV> that you position right at the bottom
of the window? Just above the status bar?

That's easy to do. Here's a simple demo HTML page:

<html><body>
<div id="STATUS" style="position: absolute; width: 100%; height: 24px;
bottom:0px; color: white; background-color: black;"></div>

<form>
<input onchange='vbscript: document.getElementById("STATUS").innerHTML =
me.value' size=100>
</form>
</body></html>
My System SpecsSystem Spec
Old 07-29-2008   #5 (permalink)
Joseph


 
 

Re: Is it possible to allow the use of the status bar via script, using a vbscript?

Hi Sam,

You answer is beautifully cryptic thanks - You wouldn't work for MS by any
chance?
Anyway I have read the doc on the msdn, the problem is not there its that I
have a script which relies on the status bar of a web page created at
run-time, which status bar is used to display run-time info to the user.
No way am I going to ask a user to go change their internet settings, too
complicated, trust me.

tada


"Sam Hobbs" <samuel@xxxxxx_change_social_to_socal> wrote in message
news:urBOE2N8IHA.4108@xxxxxx
Quote:

> Don't modify the registry directly when there is a documented solution and
> this is something that Microsoft would provide a documented solution for.
>
> Speaking of documentation .... guess what?
>
>
> "Joseph" <josephoget@xxxxxx> wrote in message
> news:51FC3BBA-E818-42F8-AAE5-217E247707F4@xxxxxx
Quote:

>> Hi everyone,
>>
>> Is it possible to allow the use of the status bar via script, using a
>> vbscript?
>>
>> I have a script that deletes files in the temp folders and in IE 6 it
>> would use the status bar to display its progress.
>> Not so with IE7 which for "security" reasons prevents the status bar from
>> displaying anything unless the setting is changed in Tools -> Internet
>> Options, etc.
>> Does anyone know the registry key to modify for that?
>>
>> Thanks in advance for your help.
>>
>> Joseph
>>
>
>
>
My System SpecsSystem Spec
Old 07-29-2008   #6 (permalink)
Joseph


 
 

Re: Is it possible to allow the use of the status bar via script, using a vbscript?

Thank you Mayayana,

exactly what I was looking for, I'll check this out, thank you very much for
your help.

Joseph

"mayayana" <mayaXXyana@xxxxxx> wrote in message
news:Ob6ptZO8IHA.616@xxxxxx
Quote:

> The status bar may not be the best choice, but if that's
> what you really want, see here:
>
> http://support.microsoft.com/kb/182569
>
> It looks like the value is probably 2103 set to 1.
> With "Local Machine Lockdown" possible you actually
> need to set the value in 4 places if you want to be
> sure it's not being overridden by some other hidden
> setting.
>
> Where "***" = "Software\Microsoft\Windows\CurrentVersion\Internet
> Settings"
>
> you would want to set the following:
>
> HKLM\***\Zones\0\2103
> HKCU\***\Zones\0\2103
> HKLM\***\Lockdown_Zones\0\2103
> HKCU\***\Lockdown_Zones\0\2103
>
>
>
Quote:

>>
>> Is it possible to allow the use of the status bar via script, using a
>> vbscript?
>>
>> I have a script that deletes files in the temp folders and in IE 6 it
> would
Quote:

>> use the status bar to display its progress.
>> Not so with IE7 which for "security" reasons prevents the status bar from
>> displaying anything unless the setting is changed in Tools -> Internet
>> Options, etc.
>> Does anyone know the registry key to modify for that?
>>
>> Thanks in advance for your help.
>>
>> Joseph
>>
>
>
My System SpecsSystem Spec
Old 07-29-2008   #7 (permalink)
Joseph


 
 

Re: Is it possible to allow the use of the status bar via script, usin

That actually, is NOT a dumb question at all, it is quite clever in fact, I
though of that yesterday and in view of security issues amongst others, your
idea is probably the way ahead,
Thank you for your help, much appreciated.

Joseph

"Old Pedant" <OldPedant@xxxxxx> wrote in message
news:C109F477-02FC-4886-B4C2-1608078F890B@xxxxxx
Quote:

> "Joseph" wrote:
>
Quote:

>> I have a script that deletes files in the temp folders and in IE 6 it
>> would
>> use the status bar to display its progress.
>> Not so with IE7 which for "security" reasons prevents the status bar from
>> displaying anything unless the setting is changed in Tools -> Internet
>> Options, etc.
>
> Not to ask a dumb question, but...
>
> Why not display the status in a <DIV> that you position right at the
> bottom
> of the window? Just above the status bar?
>
> That's easy to do. Here's a simple demo HTML page:
>
> <html><body>
> <div id="STATUS" style="position: absolute; width: 100%; height: 24px;
> bottom:0px; color: white; background-color: black;"></div>
>
> <form>
> <input onchange='vbscript: document.getElementById("STATUS").innerHTML =
> me.value' size=100>
> </form>
> </body></html>
My System SpecsSystem Spec
Old 07-29-2008   #8 (permalink)
mr_unreliable


 
 

Re: Is it possible to allow the use of the status bar via script,using a vbscript?

Joseph wrote:
Quote:

> Is it possible to allow the use of the status bar via script, using a
> vbscript?
>
Joseph, As has already been mentioned, using IE's
_READ_ statusbar can sometimes be problematical.

However, you can always use a "fake" statusbar, which
is not subjected to microsoft's arbitrary restrictions.

I have attached an hta which shows a "fake" statusbar,
made from a table tag. I looks pretty good, and you
can enter anything you like into it...

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but, no guarantee
the answers will be applicable to the questions)


<HTML>
<HEAD>

<script language="vbscript">
' --- discussion (avoiding that annoying hta "dialog bounce") ---
' this "trick" found on the vbScript ng, code by mikHar, 05Sept06
' Normally, an hta dialog will initially be shown in its "default"
' position and size for a brief instant. Later, when it gets
' around to running your script code, it will move/resize itself
' according to your wishes. Placing the move/resize code AHEAD
' of the hta tag seems to avoid that...
' --- end of discussion ----------------------

Const wdDlg = 600, htDlg = 380 ' dialog size
Const pxLeft = 100, pxTop = 100 ' positioning
window.ResizeTo wdDlg,htDlg
window.MoveTo pxLeft,pxTop
</script>

<HTA:APPLICATION ID="oHTA" APPLICATIONNAME="htaDebugDialogTemplate"
WINDOWSTATE="normal" SCROLL = "no" BORDERSTYLE="normal" BORDER="thin"
CAPTION="yes" MAXIMIZEBUTTON="no" MINIMIZEBUTTON="no" ICON="mru.ico"
SHOWINTASKBAR="yes" SINGLEINSTANCE="yes" SYSMENU="yes" VERSION="1.0" >

<TITLE> &nbsp;&nbsp; &lt&lt (hta) Debug Dialog Template (with Fake StatusBar) Demo Script &gt&gt </TITLE>

<SCRIPT LANGUAGE="vbScript">
<!--

' --- description block --------------------------
'
' Title: (hta) debug dialog with Fake StatusBar, jw 12May06
'
' Description: A scripting graphical user interface (gui),
' appropriate for posting debugging messages or status msgs.
' Due to difficulties with posting messages to microsoft's
' IE statusbar, there is also a "fake" statusbar included...
'
' Author: mr_unreliable
' Website: none at this time (but lurks around the wsh/vbs ng's)
'
' Usage: Use at you own risk, tested on win98se...
'
' Acknowledgments: xx/xx/xx a "xxx yyy" of the vbs newsgroup
' offered up an anternative to my "brute force" approach
' to scrolling, i.e., "scrolldown". He suggested using
' "scroll into view". His approach was incorporated here
' (although so vastly modified as to probably be unrecognizable
' to xxx.
'
' --- revision history ---------------------------
' 12May06: initial attempt (working from "regular" hta dbDlg)...
' 13May06: added "working clock"...
' 20May06: added "scroll into view" option for scrolling...
' --- end of description block -------------------

Option Explicit

' --- global variables ---------------------------
'
' Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")
' Dim oShell : Set oShell = CreateObject("WScript.Shell")
'
Dim oDoc ' as document object
Dim clkTmr ' as timer (used to update clock)
Const clkTmrInt = 995 ' clock update interval (note: LESS THAN 1 SEC)
'
Dim tRun ' as long (to keep track of running time)
Dim iItem ' as integer (to keep track of "span" tags)
Dim iMsg ' as integer (sequential number, to keep track of messages)
Const bAlignWithTop = True
Const bAlignWithBottom = False
' --- end of declarations and constants ----------


' --- initialize window size & positioning -------
' Const wdDlg = 500, htDlg = 280 ' dialog size
' do a little adjusting of my size and location...
' window.ResizeTo wdDlg,htDlg
' window.MoveTo 100,100


' --- INITIALIZATION ROUTINE ---------------------

Sub initDialog()
Const sMe = "[initDialog], "

' do a little adjusting of my size and location...
' window.ResizeTo wdDlg,htDlg
' window.MoveTo 100,100
Set oDoc = window.document

With oDoc
' resize text area...
oDoc.getElementById("msgList").style.width = wdDlg - 25
' htClientArea, less statusbar, logo, less button, less progbar, less...
oDoc.getElementById("msgList").style.height = oDoc.body.clientHeight _
- 25 - 20 - 35 - 20 ' (and less fudge factor, but don't tell anybody)...

' MsgBox("Client Width: " & oDoc.body.clientWidth _
' & "Client Height: " & oDoc.body.clientHeight)

' re-position the logo to lie just above the (fake) statusbar...
oDoc.getElementById("logo").style.top = oDoc.body.clientHeight - 47
oDoc.getElementById("logo").style.left = oDoc.body.clientWidth - 215

' re-position the (fake) statusbar at the bottom of the form (er, dialog)...
oDoc.getElementById("etchedEdge").style.top = oDoc.body.clientHeight - 25
oDoc.getElementById("fakeStatusBarFrame").style.top = oDoc.body.clientHeight - 23


' oDoc.getElementById("btnExit").disabled = False
oDoc.getElementById("btnExit").onClick = GetRef("btnExit_Click")
End With

' place a message in the main statusbar panel...
oDoc.getElementByID("statusPanel1").innerText = " The ""Main"" statusbar panel text goes here "

' place the current time in the clock panel of the statusbar...
oDoc.getElementByID("statusPanel2").innerText = " Time: " _
& formatDateTime(Time, vbLongTime)

' set clock timer, (used to update the clock)...
ClearInterval(clkTmr) : clkTmr = setInterval("clkTimer_Event", clkTmrInt, "vbscript")

tRun = 0 ' initialize the running time...
iItem = 0

dbPrint sMe & "finished.. "

' hiding the dbMsgs, for now...
oDoc.getElementByID("msgLabel").style.visibility = "visible" ' "hidden"
oDoc.getElementByID("msgList").style.visibility = "visible" ' "hidden"

End Sub


' --- SIMULATE DEBUG.PRINT -----------------------

Sub dbPrint(sMsg) ' simulates debug.print...
Dim msgID ' as string

' posting messages and scrolling down (take II)...
' In this version, the posted messages are "wrapped" into "span tags",
' and given an "id" attribute containing the "message number",
' then inserted into the listing...
msgID = "msg" & CStr(iMsg)
oDoc.getElementById("msgList").insertAdjacentHTML "BeforeEnd", _
"<span id=""" & msgID & """ >" & sMsg & "<br></span>"

' and the current/last span tag (message) is scrolled into view...
oDoc.getElementByID(msgID).scrollIntoView(bAlignWithBottom)

' also, publish the current dbMessage in the (fake) statusbar panel...
oDoc.getElementByID("statusPanel1").innerText = " " & sMsg

iMsg = iMsg + 1 ' bump up for next message
End Sub


' ------------------------------------------------
' --- EVENT HANDLERS -----------------------------
' ------------------------------------------------

Sub clkTimer_Event() ' update the clock
Const sMe = "[timer], "

' msgbox("timer event detected")
oDoc.getElementByID("statusPanel2").innerText = " Time: " _
& formatDateTime(Time, vbLongTime)

' every to often, post a debug message, just for the entertainment value...
tRun = tRun + 1
' if ((tRun mod 10) = 0) then dbPrint sMe & "elapsed time: " & CStr(tRun) & " secs"
dbPrint sMe & "elapsed time: " & CStr(tRun) & " secs"
End Sub


Sub btnExit_Click()
Const sMe = "[btnClick], "
' MsgBox("detected Click Event")
ClearInterval(clkTmr) ' stop the clock timer

' post a notification to the debug window...
dbPrint "" ' space
dbPrint sMe & " ..detected Exit Button Click Event "
dbPrint sMe & " (this window will close in 1 sec) "

' wait-a-bit, to allow for reading the msg,
' by setting ANOTHER timer, to close this dialog window...
SetTimeout "Window.Close", 1000

End Sub


Sub CleanUp()

' msgbox("onUnload event detected")
ClearInterval(clkTmr)
End Sub




//-->
</SCRIPT>
<style>
body {font-family: ms sans serif; font-size: 10pt; font-weight: 400; color: Navy;
margin-top: 4px; margin-left: 1px; margin-right: 1px; margin-bottom: 1px;
height: 10px; width: 10px; border-style: none; }
div {border-style: inset; border-width: 2; background-color:aliceblue;
overflow:auto; text-align:left;
font-family:verdana; font-size:10pt; font-weight:400; color:Navy; }
textarea {font-family: verdana; font-size: 10pt; font-weight: 400; color: Navy; }
button {margin-top: 7px; height: 25px; width: 100px; font-family: verdana; font-weight: 600;
width: 125px; }

h3 {margin-top: 3px; margin-bottom: 2px; padding-top: 0%; padding-bottom: 0%;
font-family: verdana; font-size: 8pt; font-weight: 400; color: Navy; }
h4 {position:absolute; top:100; left: 2;
margin-top: 6px; margin-bottom: 0px; padding-top: 0%; padding-bottom: 0%;
font-family: Arial; font-size: 8pt; font-weight: Normal; font-style: Italic;
color: Navy; }

hr {position:absolute; top:100; left: 2; margin-top: 1px; margin-bottom: 1px; }
table {position:absolute; top:110; left: 1; margin-top: 1px; margin-bottom: 1px;
border-style: none; border-width: 1; width: 100%; height: 20px; }
td {border-style: inset; border-width: 2;
font-family: verdana; font-size: 8pt; font-weight: normal; color: Navy }
</style>
</HEAD>

<!-- this is the "mother" (a.k.a. "debug dialog") page -->
<BODY onload="initDialog()" onUnload="CleanUp()" scroll='no' text='navy' bgcolor="silver" >
<h3 id="msgLabel" >&nbsp;&nbsp;debugging messages... </h3>
<CENTER>
<!-- using "div" element (instead of textarea) for posting messages,
instead of a listbox (i.e., what you would have used in vb)... -->
<DIV id="msgList" >

</DIV>

<BUTTON id="btnExit" onclick="window.close()" >Exit</BUTTON>
</CENTER>

<h4 id="logo" ALIGN=RIGHT >&nbsp;jawar productions (all rights reserved)... </h4>

<!-- using table as (fake) statusbar. (with "inset" border) -->
<hr id="etchedEdge" width=99% align=center >
<TABLE id="fakeStatusBarFrame" width=99% bgcolor=silver align=center ><TR>
<TD id="statusPanel1" bgcolor=silver >&nbsp;
<TD id="statusPanel2" style="width: 120px; ">&nbsp; Time 12:00:00 </TR></TABLE>

</BODY>
</HTML>
My System SpecsSystem Spec
Old 07-29-2008   #9 (permalink)
Old Pedant


 
 

Re: Floating DIV OK BUT...

"Joseph" wrote:
Quote:

> the problem is that it flickers so much it is nearly impossible to read
> what's in it.
You mean because you are changing the display so rapidly? And because it's
in a <DIV> it has to keep redrawing it?

If so, I'm surprised that the status line doesn't flicker, too.

I can think of a number of ways to try to reduce the flicker. One, of
course, is to *NOT* use inverse video. Just leaving the pseudo-status bar
the same color as the background should help a lot.

Might help to put a <SPAN> inside the <DIV> and just change the innerHTML of
the <SPAN>.

Could possibly put a "throttle" on that changing, so that changes aren't
displayed if they occur less than 50ms (or whatever number) after the prior
displayed one. That woudn't be hard.

Let's see...

<script>
var newStatus = "";

function updateStatus( )
{
document.getElementById("STATUS").innerHTML = newStatus;
setTimeout( "updateStatus( )", 100 );
}
</script>

And then do
<body onLoad="updateStatus( )">
and finally, instead of changing the innerHTML directly, have your code
simply dump the new messages into the
newStatus
variable. And then the timeout ensures that the display isn't updated more
than once every 100ms. So if the variable is updated more often, the
intermediate changes are just dropped into the old bitbucket.

Is that adequate?


My System SpecsSystem Spec
Old 07-30-2008   #10 (permalink)
mr_unreliable


 
 

Re: Is it possible to allow the use of the status bar via script,using a vbscript?

mr_unreliable wrote:
Quote:

> Joseph, As has already been mentioned, using IE's
> _READ_ statusbar can sometimes be problematical.
>
Uh-oh, I meant IE's _REAL_ statusbar...

fumble-fingers, jw
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Pure Vb script progress or status bar VB Script
VBScript Login Script Vista security
can i use vbscript or powershell to script with livemail desktop? Live Mail
Problem setting Param($Status) in PS script PowerShell
Logon Script - VBScript Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46