Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / December 2003

Tip: Looking for answers? Try searching our database.

Is there a way to turn the self window's toolbar off

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
haiwen - 18 Dec 2003 17:42 GMT
Hello,everyone.

When we want to open a new window, we can set up the new
window without toolbar.

But if I don't want to open the new window, I just want to
turn the current (self) window's toolbar off. Is it
possible? Could anyone help? I do appreciate it.

Haiwen
Wei-Dong Xu [MSFT] - 19 Dec 2003 10:53 GMT
Hi haiwen,

Thank you for posting in MSDN managed newsgroup!

From my understanding to this issue, you'd like to hide the toolbar of the internet explorer which hosts the current html document.

If so, based on my experience, we can automate IE with client side code. There is one VBscript sample code which can help you a lot regarding
this.
<!-- code begin -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<!-- set the document title to "test-->]]" -->
<!-- then we will try to locate this window form shell.application and then  -->
<!-- hide the toolbar -->
<!-- I use a very special name only for test, please change it according your scenario -->
<TITLE>test-->]]</TITLE>
<Script language=vbscript>
sub fDisableToolBar()
set objShlAPP = createobject("shell.application")
for each subW in objShlAPP.windows
    if lcase(typename(subW.document)) = "htmldocument" then
        Set objIE = CreateObject("InternetExplorer.Application")
        Set objIE = subW
        if objIE.document.Title = "test-->]]" Then
            objIE.ToolBar = false
        end if
    end if
next
end sub
</script>
</HEAD>

<BODY>
<input type="button" value="Disable Tool Bar" onclick='fDisableToolbar()'></input>
</BODY>
</HTML>
<!-- code end -->

Please feel free to let me know if you have any further questions.

Does this answer your question? Thank you for using Microsoft NewsGroup!

Wei-Dong Xu
Microsoft Product Support Services
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

haiwen - 19 Dec 2003 14:37 GMT
Hello,Wei-Dong Xu

Thank you so much for your help.
I try your code, but I always get error (Pemission Denied)
in line 13 that is
for each subW in objShlAPP.windows

By the way, could we use javascript or jscript to do the
same work. Thanks for your help again.

haiwen
>-----Original Message-----
>Hi haiwen,
>
>Thank you for posting in MSDN managed newsgroup!
>
>From my understanding to this issue, you'd like to hide the toolbar of the internet explorer which hosts the
current html document.

>If so, based on my experience, we can automate IE with client side code. There is one VBscript sample code which
can help you a lot regarding
>this.
><!-- code begin -->
[quoted text clipped - 38 lines]
>
>.
Wei-Dong Xu [MSFT] - 20 Dec 2003 08:32 GMT
Hi haiwen,

Thank you for replying!

For security consideration, if you run this jscript automation code in the client, it will be denied. Because if javascript obtain high permission to run
such codes, it will then obtain high control ability for the computer which will a very severe security vulnerability of the client box. So if you want to
deply this web page in the web environment, it will be denied by cilent side. However, the client side can download this web page and then run it
with one high-permission user account logged in (the administrator account is the best to run this script code). If in the web scenario, so far as I
know, you will have to use the open method of javascript to create one new window without toolbar.

Furthermore, you can rewrite the vbscript code to JScript code. The reference of JScript and VBscript is available from Microsoft.com. Please go to:
Jscript Reference
http://msdn.microsoft.com/library/en-us/script56/html/js56jsoriJScript.asp?frame=true
VBscript Reference
http://msdn.microsoft.com/library/en-us/script56/html/vtoriVBScript.asp?frame=true

Please feel free to let me know if you have any further questions.

Does this answer your question? Thank you for using Microsoft NewsGroup!

Wei-Dong Xu
Microsoft Product Support Services
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

SU - 21 Dec 2003 18:54 GMT
Wei-Dong Xu.
good job Xu, you handled the question in a professional manner. MicroSoft is
luckly to have you  as an employee. Keep up the good work!

Thanks
One of the Misoftsoft stock holder

> Hi haiwen,
>
> Thank you for replying!
>
> For security consideration, if you run this jscript automation code in the client, it will be denied. Because if javascript obtain high permission to
run
> such codes, it will then obtain high control ability for the computer which will a very severe security vulnerability of the client box. So if you
want to
> deply this web page in the web environment, it will be denied by cilent side. However, the client side can download this web page and then run it
> with one high-permission user account logged in (the administrator account is the best to run this script code). If in the web scenario, so far as I
> know, you will have to use the open method of javascript to create one new window without toolbar.
>
> Furthermore, you can rewrite the vbscript code to JScript code. The reference of JScript and VBscript is available from Microsoft.com. Please go
to:
> Jscript Reference

http://msdn.microsoft.com/library/en-us/script56/html/js56jsoriJScript.asp?f
rame=true
> VBscript Reference

http://msdn.microsoft.com/library/en-us/script56/html/vtoriVBScript.asp?fram
e=true

> Please feel free to let me know if you have any further questions.
>
[quoted text clipped - 4 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
Wei-Dong Xu [MSFT] - 23 Dec 2003 03:07 GMT
Hi,

Thank you for replying!

It is my pleasure to be some of service!

Thank you once more for using Microsoft NewsGroup!

Wei-Dong Xu
Microsoft Product Support Services
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Joe Fawcett - 23 Dec 2003 11:11 GMT
> Hi haiwen,
>
[quoted text clipped - 34 lines]
> </HTML>
> <!-- code end -->

Instead of having a specific title a better test is to do:
If subW.document.parentWindow = self Then '...
You also need a recent shell32.dll version 4.71 or later.

Joe

Joe

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.