Hi all,
i want find a way to show in a popup or in ie windows a status message
of the script:
......part of the some script in a loop
For Each objUser in objOldOU
strstreetAddress = objUser.Get("streetAddress")
'wscript.echo strstreetAddress
Select Case (strstreetAddress)
Case "MI- Europa"
oudest = "LDAP://ou=Utenti,ou=Europa,ou=Sedi," & varDomainNC
objUser.Put "scriptPath", "europa.cmd"
MESSAGE = "SELECT CASE 1"
Case "Cavallotti"
oudest = "LDAP://ou=Utenti,ou=Cavallotti,ou=Sedi," & varDomainNC
objUser.Put "scriptPath", "cavallotti.cmd"
MESSAGE = "SELECT CASE 2"
Case "Broletto"
oudest = "LDAP://ou=Utenti,ou=Broletto,ou=Sedi," & varDomainNC
objUser.Put "scriptPath", "broletto.cmd"
MESSAGE = "SELECT CASE 3"
Case "Mi - Sempione"
oudest = "LDAP://ou=Utenti,ou=Sempione,ou=Sedi," & varDomainNC
objUser.Put "scriptPath", "sempione.cmd"
MESSAGE = "SELECT CASE 4"
End Select
objUser.SetInfo
Set objNewOU = GetObject(oudest)
WSCRIPT.ECHO MESSAGE
objNewOU.MoveHere objUser.ADsPath, vbNullString
It's possible open a message and close it after some second without
the user click on some button?
Thx in advance.
Maw
|
|
0
|
|
|
|
Reply
|
Maw
|
6/10/2010 3:38:35 PM |
|
On Jun 10, 11:38=A0am, Maw <maw81...@gmail.com> wrote:
> Hi all,
> i want find a way to show in a popup or in ie windows a status message
> of the script:
>
> .....part of the some script in a loop
>
> For Each objUser in objOldOU
> =A0 =A0 =A0 =A0 strstreetAddress =3D objUser.Get("streetAddress")
> =A0 =A0 =A0 =A0 'wscript.echo strstreetAddress
> =A0 =A0 =A0 =A0 Select Case (strstreetAddress)
> =A0 =A0 =A0 =A0 Case "MI- Europa"
> =A0 =A0 =A0 =A0 oudest =3D "LDAP://ou=3DUtenti,ou=3DEuropa,ou=3DSedi," & =
varDomainNC
> =A0 =A0 =A0 =A0 objUser.Put "scriptPath", "europa.cmd"
> =A0 =A0 =A0 =A0 MESSAGE =3D "SELECT CASE 1"
> =A0 =A0 =A0 =A0 Case "Cavallotti"
> =A0 =A0 =A0 =A0 oudest =3D "LDAP://ou=3DUtenti,ou=3DCavallotti,ou=3DSedi,=
" & varDomainNC
> =A0 =A0 =A0 =A0 objUser.Put "scriptPath", "cavallotti.cmd"
> =A0 =A0 =A0 =A0 MESSAGE =3D "SELECT CASE 2"
> =A0 =A0 =A0 =A0 Case "Broletto"
> =A0 =A0 =A0 =A0 oudest =3D "LDAP://ou=3DUtenti,ou=3DBroletto,ou=3DSedi," =
& varDomainNC
> =A0 =A0 =A0 =A0 objUser.Put "scriptPath", "broletto.cmd"
> =A0 =A0 =A0 =A0 MESSAGE =3D "SELECT CASE 3"
> =A0 =A0 =A0 =A0 Case "Mi - Sempione"
> =A0 =A0 =A0 =A0 oudest =3D "LDAP://ou=3DUtenti,ou=3DSempione,ou=3DSedi," =
& varDomainNC
> =A0 =A0 =A0 =A0 objUser.Put "scriptPath", "sempione.cmd"
> =A0 =A0 =A0 =A0 MESSAGE =3D "SELECT CASE 4"
> =A0 =A0 =A0 =A0 End Select
> =A0 =A0 =A0 =A0 objUser.SetInfo
> =A0 =A0 =A0 =A0 Set objNewOU =3D GetObject(oudest)
> =A0 =A0 =A0 =A0 WSCRIPT.ECHO MESSAGE
> =A0 =A0 =A0 =A0 objNewOU.MoveHere objUser.ADsPath, vbNullString
>
> It's possible open a message and close it after some second without
> the user click on some button?
> Thx in advance.
>
> Maw
The simplest solution if the Wscript.Shell Popup function ...
Set WshShell =3D CreateObject("WScript.Shell")
WshShell.Popup "Your message here", 5, "Title", vbOkay +
vbExclamation
See the WSH documentation for more information.
WSH 5.6+ documentation download (URL all one line)
http://www.microsoft.com/downloads/details.aspx?FamilyId=3D01592C48-207D-4B=
E1-8A76-1C4099D7BBB9&displaylang=3Den
The other approach is to build your own adaptable display through the
IE document object model. I've posted a number of examples here in
the past. Try a groups.google search.
_____________________
Tom Lavedas
|
|
0
|
|
|
|
Reply
|
Tom
|
6/10/2010 5:28:34 PM
|
|
Tom Lavedas wrote:
<snipped>
> The other approach is to build your own adaptable display through the
> IE document object model. I've posted a number of examples here in
> the past. Try a groups.google search.
I like using HTA scripts for dynamic displays.
--
Crash
"The real question is not whether machines think but whether men do."
~ B. F. Skinner ~
|
|
0
|
|
|
|
Reply
|
Dave
|
6/10/2010 6:49:57 PM
|
|
On 10 Giu, 19:28, Tom Lavedas <tglba...@verizon.net> wrote:
> On Jun 10, 11:38=A0am, Maw <maw81...@gmail.com> wrote:
>
>
>
> > Hi all,
> > i want find a way to show in a popup or in ie windows a status message
> > of the script:
>
> > .....part of the some script in a loop
>
> > For Each objUser in objOldOU
> > =A0 =A0 =A0 =A0 strstreetAddress =3D objUser.Get("streetAddress")
> > =A0 =A0 =A0 =A0 'wscript.echo strstreetAddress
> > =A0 =A0 =A0 =A0 Select Case (strstreetAddress)
> > =A0 =A0 =A0 =A0 Case "MI- Europa"
> > =A0 =A0 =A0 =A0 oudest =3D "LDAP://ou=3DUtenti,ou=3DEuropa,ou=3DSedi," =
& varDomainNC
> > =A0 =A0 =A0 =A0 objUser.Put "scriptPath", "europa.cmd"
> > =A0 =A0 =A0 =A0 MESSAGE =3D "SELECT CASE 1"
> > =A0 =A0 =A0 =A0 Case "Cavallotti"
> > =A0 =A0 =A0 =A0 oudest =3D "LDAP://ou=3DUtenti,ou=3DCavallotti,ou=3DSed=
i," & varDomainNC
> > =A0 =A0 =A0 =A0 objUser.Put "scriptPath", "cavallotti.cmd"
> > =A0 =A0 =A0 =A0 MESSAGE =3D "SELECT CASE 2"
> > =A0 =A0 =A0 =A0 Case "Broletto"
> > =A0 =A0 =A0 =A0 oudest =3D "LDAP://ou=3DUtenti,ou=3DBroletto,ou=3DSedi,=
" & varDomainNC
> > =A0 =A0 =A0 =A0 objUser.Put "scriptPath", "broletto.cmd"
> > =A0 =A0 =A0 =A0 MESSAGE =3D "SELECT CASE 3"
> > =A0 =A0 =A0 =A0 Case "Mi - Sempione"
> > =A0 =A0 =A0 =A0 oudest =3D "LDAP://ou=3DUtenti,ou=3DSempione,ou=3DSedi,=
" & varDomainNC
> > =A0 =A0 =A0 =A0 objUser.Put "scriptPath", "sempione.cmd"
> > =A0 =A0 =A0 =A0 MESSAGE =3D "SELECT CASE 4"
> > =A0 =A0 =A0 =A0 End Select
> > =A0 =A0 =A0 =A0 objUser.SetInfo
> > =A0 =A0 =A0 =A0 Set objNewOU =3D GetObject(oudest)
> > =A0 =A0 =A0 =A0 WSCRIPT.ECHO MESSAGE
> > =A0 =A0 =A0 =A0 objNewOU.MoveHere objUser.ADsPath, vbNullString
>
> > It's possible open a message and close it after some second without
> > the user click on some button?
> > Thx in advance.
>
> > Maw
>
> The simplest solution if the Wscript.Shell Popup function ...
>
> =A0 Set WshShell =3D CreateObject("WScript.Shell")
> =A0 WshShell.Popup "Your message here", 5, "Title", vbOkay +
> vbExclamation
>
> See the WSH documentation for more information.
> WSH 5.6+ documentation download (URL all one line)http://www.microsoft.co=
m/downloads/details.aspx?FamilyId=3D01592C48-207...
>
> The other approach is to build your own adaptable display through the
> IE document object model. =A0I've posted a number of examples here in
> the past. =A0Try a groups.google search.
> _____________________
> Tom Lavedas
Hi,
i like the WshShell.Popup but i don't want the button, it's possible?
And HTA for me it's a new way, i don't know the code!!!
thx
|
|
0
|
|
|
|
Reply
|
Maw
|
6/11/2010 7:28:02 AM
|
|
Maw wrote:
> On 10 Giu, 19:28, Tom Lavedas <tglba...@verizon.net> wrote:
>> On Jun 10, 11:38 am, Maw <maw81...@gmail.com> wrote:
>>
>>
>>
>>> Hi all, i want find a way to show in a popup or in ie windows a
>>> status message of the script: .....part of the some script in a
>>> loop For Each objUser in objOldOU strstreetAddress =
>>> objUser.Get("streetAddress") 'wscript.echo strstreetAddress
>>> Select Case (strstreetAddress) Case "MI- Europa" oudest =
>>> "LDAP://ou=Utenti,ou=Europa,ou=Sedi," & varDomainNC objUser.Put
>>> "scriptPath", "europa.cmd" MESSAGE = "SELECT CASE 1" Case
>>> "Cavallotti" oudest = "LDAP://ou=Utenti,ou=Cavallotti,ou=Sedi," &
>>> varDomainNC objUser.Put "scriptPath", "cavallotti.cmd" MESSAGE =
>>> "SELECT CASE 2" Case "Broletto" oudest =
>>> "LDAP://ou=Utenti,ou=Broletto,ou=Sedi," & varDomainNC objUser.Put
>>> "scriptPath", "broletto.cmd" MESSAGE = "SELECT CASE 3" Case "Mi -
>>> Sempione" oudest = "LDAP://ou=Utenti,ou=Sempione,ou=Sedi," &
>>> varDomainNC objUser.Put "scriptPath", "sempione.cmd" MESSAGE =
>>> "SELECT CASE 4" End Select objUser.SetInfo Set objNewOU =
>>> GetObject(oudest) WSCRIPT.ECHO MESSAGE objNewOU.MoveHere
>>> objUser.ADsPath, vbNullString It's possible open a message and
>>> close it after some second without the user click on some button?
>>> Thx in advance. Maw
>> The simplest solution if the Wscript.Shell Popup function ...
>>
>> Set WshShell = CreateObject("WScript.Shell") WshShell.Popup "Your
>> message here", 5, "Title", vbOkay + vbExclamation
>>
>> See the WSH documentation for more information. WSH 5.6+
>> documentation download (URL all one
>> line)http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207...
>>
>>
>> The other approach is to build your own adaptable display through
>> the IE document object model. I've posted a number of examples
>> here in the past. Try a groups.google search.
>> _____________________ Tom Lavedas
>
>
>
> Hi, i like the WshShell.Popup but i don't want the button, it's
> possible?
No.
> And HTA for me it's a new way, i don't know the code!!!
It is the same as a scripted web page except with a HTA extension
instead of HTM, and you have all the privileges of a VBS script.
http://en.wikipedia.org/wiki/HTML_Application
--
Crash
"When you get to a fork in the road, take it."
~ Yogi Berra ~
|
|
0
|
|
|
|
Reply
|
Dave
|
6/11/2010 8:11:45 AM
|
|
On Jun 11, 4:11=A0am, "Dave \"Crash\" Dummy" <inva...@invalid.invalid>
wrote:
> Maw wrote:
> > On 10 Giu, 19:28, Tom Lavedas <tglba...@verizon.net> wrote:
> >> On Jun 10, 11:38 am, Maw <maw81...@gmail.com> wrote:
>
> >>> Hi all, i want find a way to show in a popup or in ie windows a
> >>> status message of the script: .....part of the some script in a
> >>> loop For Each objUser in objOldOU strstreetAddress =3D
> >>> objUser.Get("streetAddress") 'wscript.echo strstreetAddress
> >>> Select Case (strstreetAddress) Case "MI- Europa" oudest =3D
> >>> "LDAP://ou=3DUtenti,ou=3DEuropa,ou=3DSedi," & varDomainNC objUser.Put
> >>> "scriptPath", "europa.cmd" MESSAGE =3D "SELECT CASE 1" Case
> >>> "Cavallotti" oudest =3D "LDAP://ou=3DUtenti,ou=3DCavallotti,ou=3DSedi=
," &
> >>> varDomainNC objUser.Put "scriptPath", "cavallotti.cmd" MESSAGE =3D
> >>> "SELECT CASE 2" Case "Broletto" oudest =3D
> >>> "LDAP://ou=3DUtenti,ou=3DBroletto,ou=3DSedi," & varDomainNC objUser.P=
ut
> >>> "scriptPath", "broletto.cmd" MESSAGE =3D "SELECT CASE 3" Case "Mi -
> >>> Sempione" oudest =3D "LDAP://ou=3DUtenti,ou=3DSempione,ou=3DSedi," &
> >>> varDomainNC objUser.Put "scriptPath", "sempione.cmd" MESSAGE =3D
> >>> "SELECT CASE 4" End Select objUser.SetInfo Set objNewOU =3D
> >>> GetObject(oudest) WSCRIPT.ECHO MESSAGE objNewOU.MoveHere
> >>> objUser.ADsPath, vbNullString It's possible open a message and
> >>> close it after some second without the user click on some button?
> >>> =A0Thx in advance. Maw
> >> The simplest solution if the Wscript.Shell Popup function ...
>
> >> Set WshShell =3D CreateObject("WScript.Shell") WshShell.Popup "Your
> >> message here", 5, "Title", vbOkay + vbExclamation
>
> >> See the WSH documentation for more information. WSH 5.6+
> >> documentation download (URL all one
> >> line)http://www.microsoft.com/downloads/details.aspx?FamilyId=3D01592C=
48-207...
>
> >> The other approach is to build your own adaptable display through
> >> the IE document object model. =A0I've posted a number of examples
> >> here in the past. =A0Try a groups.google search.
> >> _____________________ Tom Lavedas
>
> > Hi, i like the WshShell.Popup but i don't want the button, it's
> > possible?
>
> No.
>
> > And HTA for me it's a new way, i don't know the code!!!
>
> It is the same as a scripted web page except with a HTA extension
> instead of HTM, and you have all the privileges of a VBS script.http://en=
..wikipedia.org/wiki/HTML_Application
> --
> Crash
>
> "When you get to a fork in the road, take it."
> ~ Yogi Berra ~
Here is a no button box using IE, which can be integrated into an
existing VBS script ...
sMessage =3D "This is your message"
nobtnbox sMessage, 3, "Title goes here"
nobtnbox "<b>" & sMessage & " emphasized", 3, "Title goes here"
nobtnbox "<font color=3Dred>" & sMessage & "in red", 3, "Title goes
here"
Sub NoBtnBox(sMsg, nWait, sTitle)
Dim Height, Width, oIE
' Default values ...
height =3D 100 : width =3D 400
set oIE =3D CreateObject("InternetExplorer.Application")
With oIE
.RegisterAsDropTarget =3D False
.toolbar =3D false : .statusbar =3D false
.menubar =3D false : .addressbar =3D false
.width =3D Width : .height =3D Height
.Navigate "about:blank"
Do Until .ReadyState =3D 4 : WScript.Sleep 50 : Loop
With .document
.open
.write "<html><head><title>MsgBox ...</title></head>" _
& "<body id=3Dbdy bgColor=3Dsilver scroll=3Dno " _
& "style=3D'font-family:sans-serif'><center>" _
& "<span id=3Dmsg></spam></center></body></html>"
.close
Do Until oIE.ReadyState =3D 4 : WScript.Sleep 50 : Loop
With .parentWindow.screen
oIE.left =3D (.width - oIE.width )\ 2
oIE.top =3D (.height- oIE.height)\ 2
End With
.title =3D sTitle
.all.msg.innerHTML =3D sMsg
End With ' document
.Visible =3D True
CreateObject("Wscript.Shell").AppActivate "MsgBox ..."
End With ' IE
wsh.sleep nWait * 1000
oIe.Quit
End sub
Unfortunately, IE versions of 7 and above prohibit removal of the
title bar and recent Hotfixes added an http:// prefix for all URLs,
even "about:blank". It can actually be done using an HTA that is
built on-the-fly, but it's way too complicated. The only reason a
person would do that would be to get rid of that ugly title bar. In
general, it's probably not worth the bother - it may be better to go
out and find a third party control that does it easier and better.
_____________________
Tom Lavedas
|
|
0
|
|
|
|
Reply
|
Tom
|
6/11/2010 3:01:40 PM
|
|
On Jun 11, 11:01=A0am, Tom Lavedas <tglba...@verizon.net> wrote:
{snip}
>=A0It can actually be done using an HTA that is
> built on-the-fly, but it's way too complicated. =A0The only reason a
> person would do that would be to get rid of that ugly title bar. =A0In
> general, it's probably not worth the bother - it may be better to go
> out and find a third party control that does it easier and better.
> _____________________
> Tom Lavedas
It turned out to be much easier than I thought, thanks to a
trick"Mayayana" posted here not too long ago ...
set oMsgBox =3D NewMsgBox("lightgrey")
oMsgBox.document.title =3D "No Button Message Box"
oMsgBox.msg.innerText =3D "A new message"
wsh.sleep 5000
oMsgBox.close
Function NewMsgBox(sBgColor)
Dim IE, HTA
with CreateObject("WScript.Shell")
.Run "MSHTA.EXE " _
& """javascript:new ActiveXObject('InternetExplorer.Application')"
_
& ".PutProperty('ID1',window);""", 1, False
do until .AppActivate("javascript:new")
WScript.sleep 50
loop
end with ' Shell
For Each IE In CreateObject("Shell.Application").Windows
If IsObject(IE.GetProperty("ID1")) Then
Set HTA =3D IE.GetProperty("ID1")
HTA.resizeTo 300,100 : HTA.moveto 500, 400
with HTA.document
.write "<HTA:Application contextMenu=3Dno border=3Ddialog " _
& "minimizebutton=3Dno maximizebutton=3Dno sysmenu=3Dno />" _
& "<body scroll=3Dno style=3D'background-color:" _
& sBgColor & ";font:normal 12pt Arial'>" _
& "<center><span id=3Dmsg> </span><center></body>"
end with
IE.quit
Exit For
End If
Next
set NewMsgBox =3D HTA
End Function
This is intended as a bare bones prototype that can be modified to
meet particular needs. I built this version to pass the HTA object
back to the calling program. This allows full DHTML access to the
entire DOM, making for the highest possible versatility. The function
can be tailored to do the whole job, retuning only when the message
timeout is reached.
The big advantage of this approach is the removal of all of the IE
'chrome'. The disadvantage is that the initial HTA frame flashes onto
the screen, before it is resized to the programmed sizes. This is
usually suppressed in a standalone HTA by placing a 'resizeTo'
statement at the very top of the file before any other definitions or
scripting. I haven't figured out how to emulate that here.
_____________________
Tom Lavedas
|
|
0
|
|
|
|
Reply
|
Tom
|
6/11/2010 7:13:53 PM
|
|
"Tom Lavedas" <tglbatch@verizon.net> wrote in message
news:422ff750-711d-44f5-a3bb-4adba77b2bd2@k39g2000yqd.googlegroups.com...
On Jun 11, 11:01 am, Tom Lavedas <tglba...@verizon.net> wrote:
{snip}
> It turned out to be much easier than I thought, thanks to a
> trick"Mayayana" posted here not too long ago ...
>
> set oMsgBox = NewMsgBox("lightgrey")
> oMsgBox.document.title = "No Button Message Box"
> oMsgBox.msg.innerText = "A new message"
> wsh.sleep 5000
> oMsgBox.close
>
> Function NewMsgBox(sBgColor)
> Dim IE, HTA
>
> with CreateObject("WScript.Shell")
> .Run "MSHTA.EXE " _
> & """javascript:new ActiveXObject('InternetExplorer.Application')"
> _
> & ".PutProperty('ID1',window);""", 1, False
>
> do until .AppActivate("javascript:new")
> WScript.sleep 50
> loop
> end with ' Shell
>
> For Each IE In CreateObject("Shell.Application").Windows
> If IsObject(IE.GetProperty("ID1")) Then
> Set HTA = IE.GetProperty("ID1")
> HTA.resizeTo 300,100 : HTA.moveto 500, 400
> with HTA.document
> .write "<HTA:Application contextMenu=no border=dialog " _
> & "minimizebutton=no maximizebutton=no sysmenu=no />" _
> & "<body scroll=no style='background-color:" _
> & sBgColor & ";font:normal 12pt Arial'>" _
> & "<center><span id=msg> </span><center></body>"
> end with
> IE.quit
> Exit For
> End If
> Next
>
> set NewMsgBox = HTA
>
> End Function
>
> This is intended as a bare bones prototype that can be modified to
> meet particular needs. I built this version to pass the HTA object
> back to the calling program. This allows full DHTML access to the
> entire DOM, making for the highest possible versatility. The function
> can be tailored to do the whole job, retuning only when the message
> timeout is reached.
>
> The big advantage of this approach is the removal of all of the IE
> 'chrome'. The disadvantage is that the initial HTA frame flashes onto
> the screen, before it is resized to the programmed sizes. This is
> usually suppressed in a standalone HTA by placing a 'resizeTo'
> statement at the very top of the file before any other definitions or
> scripting. I haven't figured out how to emulate that here.
I am not sure if it is in scope for what OP asked for, but you can alter
this to have a message box with a timeout that does not stop the script by
using the 'execScript' method. Just remove the 'wsh.sleep 5000' &
'oMsgBox.close' lines from the above script and replace them with:
oMsgBox.document.parentWindow.execScript _
"setTimeout ""window.close()"", 5000", "VBScript"
|
|
0
|
|
|
|
Reply
|
James
|
6/11/2010 11:40:58 PM
|
|
On Jun 11, 7:40=A0pm, "James Whitlow" <jwhitlow.60372...@bloglines.com>
wrote:
> "Tom Lavedas" <tglba...@verizon.net> wrote in message
>
> news:422ff750-711d-44f5-a3bb-4adba77b2bd2@k39g2000yqd.googlegroups.com...
> On Jun 11, 11:01 am, Tom Lavedas <tglba...@verizon.net> wrote:
> {snip}
>
> > It turned out to be much easier than I thought, thanks to a
> > trick"Mayayana" posted here not too long ago ...
>
> > set oMsgBox =3D NewMsgBox("lightgrey")
> > oMsgBox.document.title =3D "No Button Message Box"
> > oMsgBox.msg.innerText =3D "A new message"
> > wsh.sleep 5000
> > oMsgBox.close
>
> > Function NewMsgBox(sBgColor)
> > Dim IE, HTA
>
> > =A0 with CreateObject("WScript.Shell")
> > =A0 =A0 .Run "MSHTA.EXE " _
> > =A0 =A0 & """javascript:new ActiveXObject('InternetExplorer.Application=
')"
> > _
> > =A0 =A0 & ".PutProperty('ID1',window);""", 1, False
>
> > =A0 =A0 do until .AppActivate("javascript:new")
> > =A0 =A0 =A0 WScript.sleep 50
> > =A0 =A0 loop
> > =A0 end with ' Shell
>
> > =A0 For Each IE In CreateObject("Shell.Application").Windows
> > =A0 =A0 If IsObject(IE.GetProperty("ID1")) Then
> > =A0 =A0 =A0 Set HTA =3D IE.GetProperty("ID1")
> > =A0 =A0 =A0 HTA.resizeTo 300,100 : HTA.moveto 500, 400
> > =A0 =A0 =A0 with HTA.document
> > =A0 =A0 =A0 =A0 .write "<HTA:Application contextMenu=3Dno border=3Ddial=
og " _
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0& "minimizebutton=3Dno maximizebutton=3Dno s=
ysmenu=3Dno />" _
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0& "<body scroll=3Dno style=3D'background-col=
or:" _
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0& sBgColor & ";font:normal 12pt Arial'>" _
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0& "<center><span id=3Dmsg> </span><cent=
er></body>"
> > =A0 =A0 =A0 end with
> > =A0 =A0 =A0 IE.quit
> > =A0 =A0 =A0 Exit For
> > =A0 =A0 End If
> > =A0 Next
>
> > =A0 set NewMsgBox =3D HTA
>
> > End Function
>
> > This is intended as a bare bones prototype that can be modified to
> > meet particular needs. =A0I built this version to pass the HTA object
> > back to the calling program. =A0This allows full DHTML access to the
> > entire DOM, making for the highest possible versatility. =A0The functio=
n
> > can be tailored to do the whole job, retuning only when the message
> > timeout is reached.
>
> > The big advantage of this approach is the removal of all of the IE
> > 'chrome'. =A0The disadvantage is that the initial HTA frame flashes ont=
o
> > the screen, before it is resized to the programmed sizes. =A0This is
> > usually suppressed in a standalone HTA by placing a 'resizeTo'
> > statement at the very top of the file before any other definitions or
> > scripting. =A0I haven't figured out how to emulate that here.
>
> =A0 I am not sure if it is in scope for what OP asked for, but you can al=
ter
> this to have a message box with a timeout that does not stop the script b=
y
> using the 'execScript' method. Just remove the 'wsh.sleep 5000' &
> 'oMsgBox.close' lines from the above script and replace them with:
>
> oMsgBox.document.parentWindow.execScript _
> =A0"setTimeout ""window.close()"", 5000", "VBScript"
Yes, great idea.
______________________
Tom Lavedas
|
|
0
|
|
|
|
Reply
|
Tom
|
6/12/2010 11:40:47 AM
|
|
I all,
i have find this easy solution:
Set objExplorer =
WScript.CreateObject("InternetExplorer.Application","IE_")
objExplorer.Navigate "about:blank"
' size of window
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width=400
objExplorer.Height = 100
objExplorer.Left = 0
objExplorer.Top = 0
' window visible and starting message
objExplorer.Visible = 1
objExplorer.Document.Body.scroll = "no"
and when you need to print the message i put the code below:
objExplorer.Document.Body.InnerHTML = "Connection to AD..."
wscript.sleep(500)
it's easy but good to understand where is the script.
Only one question: It's possible remove the title bar???
Thx to all for the reply.
bye
|
|
0
|
|
|
|
Reply
|
Maw
|
6/14/2010 7:50:35 AM
|
|
On Jun 14, 3:50=A0am, Maw <maw81...@gmail.com> wrote:
> I all,
> i have find this easy solution:
>
> Set objExplorer =3D
> WScript.CreateObject("InternetExplorer.Application","IE_")
> objExplorer.Navigate "about:blank"
> ' size of window
> objExplorer.ToolBar =3D 0
> objExplorer.StatusBar =3D 0
> objExplorer.Width=3D400
> objExplorer.Height =3D 100
> objExplorer.Left =3D 0
> objExplorer.Top =3D 0
> ' window visible and starting message
> objExplorer.Visible =3D 1
> objExplorer.Document.Body.scroll =3D "no"
>
> and when you need to print the message i put the code below:
> objExplorer.Document.Body.InnerHTML =3D =A0"Connection to AD..."
> wscript.sleep(500)
>
> it's easy but good to understand where is the script.
>
> Only one question: It's possible remove the title bar???
>
> Thx to all for the reply.
>
> bye
If the machine running the script has IE 7 or later installed, the
answer is NO. For IE6 or earlier, the answer is that it can be done
by first setting the FullScreen property to True and THEN reset the
Height and Width properties to the desired values.
However, the HTA solution that I posted CAN remove the title bar.
Simply change the borderstyle property to None. However, since the
title bar in my solution has no buttons and a title that is under user
control, there really is little reason to remove it.
As far as setting it's message, it works exactly like the IE
solution. That is, the body.innerHTML can be used to set the message
(though it is a bit simpler to just use the Msg object that the
function provides.
_____________________
Tom Lavedas
|
|
0
|
|
|
|
Reply
|
Tom
|
6/14/2010 12:21:25 PM
|
|
|
10 Replies
431 Views
(page loaded in 0.264 seconds)
|