468,727 Members | 1,667 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,727 developers. It's quick & easy.

Browser Control

Hi

I'm developing an internet app. in which I want to prevent the user from
being able to browse the web whikst they are in the app. So I want to hide
the I.E. address bar and prevent any new instances of I.E. other than the one
running the app.
I.E. 5 or later are specified as the only programs for running hte app, so I
donlt have to be concerned about other, or earlier, browsers.

Any pointer would be appreciated. I can't modify the registry as the
machines are locked down, which excludes a lot of things I've seen on the web.

Thanks

David

Jul 21 '05 #1
8 1358
Hi David,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to open an IE window with no
address bar. If there is any misunderstanding, please feel free to let me
know.

As far as I know, this can only be achieved by using some client side
script. When opening a new window using window.open, we can specify this in
the feature arguments. Here is an example,

function NewWindow()
{
window.open("http://www.microsoft.com", null,
"height=200,width=400,status=no,toolbar=no,menubar =no,location=no")
}

For more information on window.open, please check the following link:

http://msdn.microsoft.com/library/de...thor/dhtml/ref
erence/methods/open_0.asp

If you're working on a Windows form app that cannot use javascripts, you
can try to add an IE web browser control.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #2
Hi Kevin

I didn't explain fully. The app is a standard .NET app written in c#.
When user goes to Url for the app, I want to close close the address bar. It
can stay closed until next time they start I.E. If necessry I will close it
on every page of my app but hopefully this won't be necessary.

Essentially we want to stop the user having access to the internet whist
running this internet app! They will be in a classroom situation and we don't
want them looking for answers! There is an invigilator keeping an eye on the
users, however...

Even more important is to stop the user running a second browser because
then, of course, they can quickly switch between the two copies, getting
answers from one and entering them into another - and if the invigilator
comes close its so easy to flick away from the second browser. If they get
caught with more than 1 browser they wil be disqualified, but that won't stop
some trying, Im sure.

Any pointer for this woudl be appreciated.

David
"Kevin Yu [MSFT]" wrote:
Hi David,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to open an IE window with no
address bar. If there is any misunderstanding, please feel free to let me
know.

As far as I know, this can only be achieved by using some client side
script. When opening a new window using window.open, we can specify this in
the feature arguments. Here is an example,

function NewWindow()
{
window.open("http://www.microsoft.com", null,
"height=200,width=400,status=no,toolbar=no,menubar =no,location=no")
}

For more information on window.open, please check the following link:

http://msdn.microsoft.com/library/de...thor/dhtml/ref
erence/methods/open_0.asp

If you're working on a Windows form app that cannot use javascripts, you
can try to add an IE web browser control.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #3
Hi David,

It hard to start an IE process from your windows form app with the address
bar hidden. So I recommend you try to use the Microsoft Web Browser control
in your app to browse a page. Here are the steps:

1. Right click in the toolbox and select Add/Remove Items...
2. On the COM Components tab, check Microsoft Web Browser and click OK.
3. Add a control to your form.

You can use the Navigate method to open the URL. HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #4
Hi Kevin

This is an internet app. It is running in Internet Explorer right from the
start.

David

"Kevin Yu [MSFT]" wrote:
Hi David,

It hard to start an IE process from your windows form app with the address
bar hidden. So I recommend you try to use the Microsoft Web Browser control
in your app to browse a page. Here are the steps:

1. Right click in the toolbox and select Add/Remove Items...
2. On the COM Components tab, check Microsoft Web Browser and click OK.
3. Add a control to your form.

You can use the Navigate method to open the URL. HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #5
Hi David,

Since it is running from a web app, I think the following script will meet
you needs. First, it opens a new IE window with no address bar. Then the
parent window closes itself. HTH.

function OpenNewWindow()
{
window.open("http://www.microsoft.com", null,
"height=200,width=400,status=no,toolbar=no,menubar =no,location=no");
window.opener=window.self;
window.close();
}

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #6
Hi Kevin

I've experimented with tis and I think I can get it to do the job.
Thank you very much for your help.

Any thoughts about preventing another instance of I.E. or of detecting one
and shutting it down?
Probably goes against all the security checks to be able to do this,
especially if XP SP2 in use! But ...

David

"Kevin Yu [MSFT]" wrote:
Hi David,

Since it is running from a web app, I think the following script will meet
you needs. First, it opens a new IE window with no address bar. Then the
parent window closes itself. HTH.

function OpenNewWindow()
{
window.open("http://www.microsoft.com", null,
"height=200,width=400,status=no,toolbar=no,menubar =no,location=no");
window.opener=window.self;
window.close();
}

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #7
You're welcome, David. However, I think it's quite hard to restrict only
one IE instance running on certain machine.

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #8
Hi Kevin

Thanks for the reply. What I am now thinking about is providing a WSH script
that can be run to change the setiup before the applicaiton is run, then a
secopnd script to run afterwards to restore the set-up. The script can them,
perhaps, set I.E. to allow input from only one web site. Then it does not
matter how many instances there are. Unfortunately I have never written a wsh
script! I'll start looking for resources to see if this approach is viable.

Thanks again,
David
"Kevin Yu [MSFT]" wrote:
You're welcome, David. However, I think it's quite hard to restrict only
one IE instance running on certain machine.

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Mark Johnson | last post: by
1 post views Thread by Praveena | last post: by
12 posts views Thread by VJ | last post: by
1 post views Thread by john conwell | last post: by
1 post views Thread by CARIGAR | last post: by
9 posts views Thread by bryonone | last post: by
xarzu
1 post views Thread by xarzu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.