473,654 Members | 3,071 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebBrowser WindowClosing


Hi all,
I am trying to avoid that a webbrowser object will be closed by a
window.close() javascript. Trying to use the WindowClosing event i
discovered that it is not fired.
I am using VB.NET 1.1 and it seems that several events have the same
problem.

Can anyone help me to solve this issue?

Vittorio
May 5 '06 #1
7 4666
A top level window can never be closed by javascript ( you will always need
the user to confirm the action )
if you are talking about a window ontop of the top level window then you
might add some script to the body`s onunload event handler

regards

Michel Posseth [MCP]
"Vittorio" <im***********@ hotmail.com> schreef in bericht
news:v9******** *************** *********@4ax.c om...

Hi all,
I am trying to avoid that a webbrowser object will be closed by a
window.close() javascript. Trying to use the WindowClosing event i
discovered that it is not fired.
I am using VB.NET 1.1 and it seems that several events have the same
problem.

Can anyone help me to solve this issue?

Vittorio

May 5 '06 #2
Hi Michel,
no, I was talking about the main window. The webBrowser shows the user
confirm dialog, but if the user closes it the object will be partially
destroyed. What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

Regards,
Vittorio

On Fri, 5 May 2006 18:04:13 +0200, "Michel Posseth [MCP]"
<MS**@posseth.c om> wrote:
A top level window can never be closed by javascript ( you will always need
the user to confirm the action )
if you are talking about a window ontop of the top level window then you
might add some script to the body`s onunload event handler

regards

Michel Posseth [MCP]
"Vittorio" <im***********@ hotmail.com> schreef in bericht
news:v9******* *************** **********@4ax. com...

Hi all,
I am trying to avoid that a webbrowser object will be closed by a
window.close() javascript. Trying to use the WindowClosing event i
discovered that it is not fired.
I am using VB.NET 1.1 and it seems that several events have the same
problem.

Can anyone help me to solve this issue?

Vittorio

May 8 '06 #3
Vittorio,
What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.
The AxWebbrowser in version 1.x is the same in VBNet as in VB6.
In Version 2.0 is a new one, although that is as AxWebbrowswer is still a
wrapper around SHDOCVW
Cor
"Vittorio" <im***********@ hotmail.com> schreef in bericht
news:o8******** *************** *********@4ax.c om... Hi Michel,
no, I was talking about the main window. The webBrowser shows the user
confirm dialog, but if the user closes it the object will be partially
destroyed. What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

Regards,
Vittorio

On Fri, 5 May 2006 18:04:13 +0200, "Michel Posseth [MCP]"
<MS**@posseth.c om> wrote:
A top level window can never be closed by javascript ( you will always
need
the user to confirm the action )
if you are talking about a window ontop of the top level window then you
might add some script to the body`s onunload event handler

regards

Michel Posseth [MCP]
"Vittorio" <im***********@ hotmail.com> schreef in bericht
news:v9****** *************** ***********@4ax .com...

Hi all,
I am trying to avoid that a webbrowser object will be closed by a
window.close() javascript. Trying to use the WindowClosing event i
discovered that it is not fired.
I am using VB.NET 1.1 and it seems that several events have the same
problem.

Can anyone help me to solve this issue?

Vittorio

May 8 '06 #4

Hi Cor,
yes it's okay... But I have to trap a non fired event!

On Mon, 8 May 2006 11:07:44 +0200, "Cor Ligthert [MVP]"
<no************ @planet.nl> wrote:
Vittorio,
What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.


The AxWebbrowser in version 1.x is the same in VBNet as in VB6.
In Version 2.0 is a new one, although that is as AxWebbrowswer is still a
wrapper around SHDOCVW
Cor
"Vittorio" <im***********@ hotmail.com> schreef in bericht
news:o8******* *************** **********@4ax. com...
Hi Michel,
no, I was talking about the main window. The webBrowser shows the user
confirm dialog, but if the user closes it the object will be partially
destroyed. What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

Regards,
Vittorio

On Fri, 5 May 2006 18:04:13 +0200, "Michel Posseth [MCP]"
<MS**@posseth.c om> wrote:
A top level window can never be closed by javascript ( you will always
need
the user to confirm the action )
if you are talking about a window ontop of the top level window then you
might add some script to the body`s onunload event handler

regards

Michel Posseth [MCP]
"Vittorio" <im***********@ hotmail.com> schreef in bericht
news:v9***** *************** ************@4a x.com...

Hi all,
I am trying to avoid that a webbrowser object will be closed by a
window.close() javascript. Trying to use the WindowClosing event i
discovered that it is not fired.
I am using VB.NET 1.1 and it seems that several events have the same
problem.

Can anyone help me to solve this issue?

Vittorio

May 8 '06 #5
Vittorio,

There are some events, but I had to use them with a timer to let them work a
little bit, so don't expect that I can give a working example. I thought
even that IE 6 with SP does not even allow closing of the window anymore. I
am not sure of that.

By instance
size.changed
navigate error

Cor

"Vittorio" <im***********@ hotmail.com> schreef in bericht
news:ab******** *************** *********@4ax.c om...

Hi Cor,
yes it's okay... But I have to trap a non fired event!

On Mon, 8 May 2006 11:07:44 +0200, "Cor Ligthert [MVP]"
<no************ @planet.nl> wrote:
Vittorio,
What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.


The AxWebbrowser in version 1.x is the same in VBNet as in VB6.
In Version 2.0 is a new one, although that is as AxWebbrowswer is still a
wrapper around SHDOCVW
Cor
"Vittorio" <im***********@ hotmail.com> schreef in bericht
news:o8****** *************** ***********@4ax .com...
Hi Michel,
no, I was talking about the main window. The webBrowser shows the user
confirm dialog, but if the user closes it the object will be partially
destroyed. What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

Regards,
Vittorio

On Fri, 5 May 2006 18:04:13 +0200, "Michel Posseth [MCP]"
<MS**@posseth.c om> wrote:

A top level window can never be closed by javascript ( you will always
need
the user to confirm the action )
if you are talking about a window ontop of the top level window then you
might add some script to the body`s onunload event handler

regards

Michel Posseth [MCP]
"Vittorio " <im***********@ hotmail.com> schreef in bericht
news:v9**** *************** *************@4 ax.com...
>
> Hi all,
> I am trying to avoid that a webbrowser object will be closed by a
> window.close() javascript. Trying to use the WindowClosing event i
> discovered that it is not fired.
> I am using VB.NET 1.1 and it seems that several events have the same
> problem.
>
> Can anyone help me to solve this issue?
>
> Vittorio

May 8 '06 #6

Hi Cor,
unfortunately when the user gives the permission the main window is
closed. This causes a partial unload of the object because of a bug.

Another way to solve my issue can be to force an unload and recreate
the control when needed, but I don't know how to recreate it.

Vittorio

On Mon, 8 May 2006 12:06:34 +0200, "Cor Ligthert [MVP]"
<no************ @planet.nl> wrote:
Vittorio,

There are some events, but I had to use them with a timer to let them work a
little bit, so don't expect that I can give a working example. I thought
even that IE 6 with SP does not even allow closing of the window anymore. I
am not sure of that.

By instance
size.changed
navigate error

Cor

"Vittorio" <im***********@ hotmail.com> schreef in bericht
news:ab******* *************** **********@4ax. com...

Hi Cor,
yes it's okay... But I have to trap a non fired event!

On Mon, 8 May 2006 11:07:44 +0200, "Cor Ligthert [MVP]"
<no************ @planet.nl> wrote:
Vittorio,

What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

The AxWebbrowser in version 1.x is the same in VBNet as in VB6.
In Version 2.0 is a new one, although that is as AxWebbrowswer is still a
wrapper around SHDOCVW
Cor
"Vittorio" <im***********@ hotmail.com> schreef in bericht
news:o8***** *************** ************@4a x.com...
Hi Michel,
no, I was talking about the main window. The webBrowser shows the user
confirm dialog, but if the user closes it the object will be partially
destroyed. What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

Regards,
Vittorio

On Fri, 5 May 2006 18:04:13 +0200, "Michel Posseth [MCP]"
<MS**@posseth.c om> wrote:

>A top level window can never be closed by javascript ( you will always
>need
>the user to confirm the action )
>if you are talking about a window ontop of the top level window then you
>might add some script to the body`s onunload event handler
>
>regards
>
>Michel Posseth [MCP]
>
>
>"Vittori o" <im***********@ hotmail.com> schreef in bericht
>news:v9*** *************** **************@ 4ax.com...
>>
>> Hi all,
>> I am trying to avoid that a webbrowser object will be closed by a
>> window.close() javascript. Trying to use the WindowClosing event i
>> discovered that it is not fired.
>> I am using VB.NET 1.1 and it seems that several events have the same
>> problem.
>>
>> Can anyone help me to solve this issue?
>>
>> Vittorio
>

May 8 '06 #7

Anyone has an idea on a solution for my event not fired issue???

Vittorio

On Mon, 08 May 2006 12:31:44 +0200, Vittorio
<im***********@ hotmail.com> wrote:

Hi Cor,
unfortunatel y when the user gives the permission the main window is
closed. This causes a partial unload of the object because of a bug.

Another way to solve my issue can be to force an unload and recreate
the control when needed, but I don't know how to recreate it.

Vittorio

On Mon, 8 May 2006 12:06:34 +0200, "Cor Ligthert [MVP]"
<no*********** *@planet.nl> wrote:
Vittorio,

There are some events, but I had to use them with a timer to let them work a
little bit, so don't expect that I can give a working example. I thought
even that IE 6 with SP does not even allow closing of the window anymore. I
am not sure of that.

By instance
size.change d
navigate error

Cor

"Vittorio" <im***********@ hotmail.com> schreef in bericht
news:ab****** *************** ***********@4ax .com...

Hi Cor,
yes it's okay... But I have to trap a non fired event!

On Mon, 8 May 2006 11:07:44 +0200, "Cor Ligthert [MVP]"
<no************ @planet.nl> wrote:

Vittorio,

>What I need to do is to avoid to unload the object and it
> can be done using the Windows Closing Object. The related event is not
> fired so it seems that something trivial in VB6 has become high tech
> in VB.NET.

The AxWebbrowser in version 1.x is the same in VBNet as in VB6.
In Version 2.0 is a new one, although that is as AxWebbrowswer is still a
wrapper around SHDOCVW
Cor
"Vittorio " <im***********@ hotmail.com> schreef in bericht
news:o8**** *************** *************@4 ax.com...
> Hi Michel,
> no, I was talking about the main window. The webBrowser shows the user
> confirm dialog, but if the user closes it the object will be partially
> destroyed. What I need to do is to avoid to unload the object and it
> can be done using the Windows Closing Object. The related event is not
> fired so it seems that something trivial in VB6 has become high tech
> in VB.NET.
>
> Regards,
> Vittorio
>
> On Fri, 5 May 2006 18:04:13 +0200, "Michel Posseth [MCP]"
> <MS**@posseth.c om> wrote:
>
>>A top level window can never be closed by javascript ( you will always
>>need
>>the user to confirm the action )
>>if you are talking about a window ontop of the top level window then you
>>might add some script to the body`s onunload event handler
>>
>>regards
>>
>>Michel Posseth [MCP]
>>
>>
>>"Vittorio " <im***********@ hotmail.com> schreef in bericht
>>news:v9** *************** *************** @4ax.com...
>>>
>>> Hi all,
>>> I am trying to avoid that a webbrowser object will be closed by a
>>> window.close() javascript. Trying to use the WindowClosing event i
>>> discovered that it is not fired.
>>> I am using VB.NET 1.1 and it seems that several events have the same
>>> problem.
>>>
>>> Can anyone help me to solve this issue?
>>>
>>> Vittorio
>>

May 10 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4426
by: Mike Z... | last post by:
Hi! I have a winform with embedded webbrowser control. When a user navigates to a page that has a link or a button that calls windows.close() javascript, the control closes yet the form does not. Since the control does not expose the onQuit() event, I need to capture the message and close my winform. I found the following Microsoft article that explains on how to do it in C++. I recently switched from Cold Fusion and have a heck of a time...
1
5569
by: Tuong | last post by:
I have a situation where i have a form that contains a webbrowser control. With this I was able to implement an application that can browse websites. One particular website i visited opens up another web page in a new window and then closes it. I was able to control this action by detecting the 'NewWindow' event and opening the webpage in my own application. Now the problem i have come across is that when the webpage that was opened in...
5
3111
by: SPE - Stani's Python Editor | last post by:
Hi, During optimizing SPE for Ubuntu, I found something strange. I have Ubuntu 5.10 "The Breezy Badger" and unfortunately this code is not working: >>> import webbrowser >>> webbrowser.open("http://www.python.org") It does not throw an exception, but is not able to launch a browser.
12
6357
by: Alex Clark | last post by:
Greetings, (.NET 2.0, WinXP Pro/Server 2003, IE6 with latest service packs). I've decided to take advantage of the layout characteristics of HTML documents to simplify my printing tasks, but of course it's thrown up a whole host of new issues... I'm generating a multi page printable document in HTML from my app, and displaying it in a WebBrowser control. I've looked into using some CSS
0
1271
by: ESmith | last post by:
In the previous WebBrowser component, I could get events (such as, WindowClosing) and act upon those event. I've tried getting the underlying ActiveX control and wiring up an event, but it doesn't seem to fire (at least I never get the notification. Can someone post a snippet of code that would use the newer WebBrowser component (v2.0.0) and catch the WindowClosing event? Thanks!
8
3400
by: Prosperz | last post by:
Hi, I would like to make thumbnails of web page by capture content of a WebBrowser. By example, capture http://www.google.com. I used WebBrowser control with Framework 2.0. I try this : *************************************************
11
2817
by: Anil Gupte | last post by:
....and how do I insert one into my form? I used in VB 6.0 last, but cannot figure out where it is in .Net Thanx, -- Anil Gupte www.keeninc.net www.icinema.com
11
2207
by: kimiraikkonen | last post by:
Hi there, I needed to use MouseOver event on Webbrowser which is NOT provided by webbrowser control natively(what a disappointment), so i decided to go with another route to simulate this like: //////////////////////////////////////////////// Public Sub DisplayHyperlinks(ByVal sender As Object, ByVal e As System.Windows.Forms.HtmlElementEventArgs)
3
9434
by: TedTrippin | last post by:
Hi, Background - I've create a windows application in VS and added a WebBrowser component and all works well. I'm now trying to do this programmatically. My application now listens on a socket and when it receives a request it creates a new Form and adds a new WebBrowser. The problem - All works well without the WebBrowser, the form is visible, but when I do "Controls.Add(webBrowser)" I see nothing, not even something in the windows...
0
8379
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8709
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8596
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2719
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1924
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1597
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.