Home All Groups Group Topic Archive Search About

WebBrowser WindowClosing

Author
5 May 2006 8:28 AM
Vittorio
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

Author
5 May 2006 4:04 PM
Michel Posseth [MCP]
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]


Show quoteHide quote
"Vittorio" <imageinact***@hotmail.com> schreef in bericht
news:v92m52lop81o8jginhrgbpqnevpkcsa5nh@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
Author
8 May 2006 8:31 AM
Vittorio
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]"
<M***@posseth.com> wrote:

Show quoteHide quote
>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" <imageinact***@hotmail.com> schreef in bericht
>news:v92m52lop81o8jginhrgbpqnevpkcsa5nh@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
>
Author
8 May 2006 9:07 AM
Cor Ligthert [MVP]
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


Show quoteHide quote
"Vittorio" <imageinact***@hotmail.com> schreef in bericht
news:o80u529rqekjmnsovkodtehaatmoqfl7u3@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]"
> <M***@posseth.com> 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" <imageinact***@hotmail.com> schreef in bericht
>>news:v92m52lop81o8jginhrgbpqnevpkcsa5nh@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
>>
Author
8 May 2006 9:39 AM
Vittorio
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]"
<notmyfirstn***@planet.nl> wrote:

Show quoteHide quote
>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" <imageinact***@hotmail.com> schreef in bericht
>news:o80u529rqekjmnsovkodtehaatmoqfl7u3@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]"
>> <M***@posseth.com> 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" <imageinact***@hotmail.com> schreef in bericht
>>>news:v92m52lop81o8jginhrgbpqnevpkcsa5nh@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
>>>
>
Author
8 May 2006 10:06 AM
Cor Ligthert [MVP]
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

Show quoteHide quote
"Vittorio" <imageinact***@hotmail.com> schreef in bericht
news:ab4u52185pp6gls7dstolouqi5rj79tjc7@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]"
> <notmyfirstn***@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" <imageinact***@hotmail.com> schreef in bericht
>>news:o80u529rqekjmnsovkodtehaatmoqfl7u3@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]"
>>> <M***@posseth.com> 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" <imageinact***@hotmail.com> schreef in bericht
>>>>news:v92m52lop81o8jginhrgbpqnevpkcsa5nh@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
>>>>
>>
Author
8 May 2006 10:31 AM
Vittorio
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]"
<notmyfirstn***@planet.nl> wrote:

Show quoteHide quote
>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" <imageinact***@hotmail.com> schreef in bericht
>news:ab4u52185pp6gls7dstolouqi5rj79tjc7@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]"
>> <notmyfirstn***@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" <imageinact***@hotmail.com> schreef in bericht
>>>news:o80u529rqekjmnsovkodtehaatmoqfl7u3@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]"
>>>> <M***@posseth.com> 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" <imageinact***@hotmail.com> schreef in bericht
>>>>>news:v92m52lop81o8jginhrgbpqnevpkcsa5nh@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
>>>>>
>>>
>
Author
9 May 2006 3:54 PM
Vittorio
Anyone has an idea on a solution for my event not fired issue???

Vittorio

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

Show quoteHide quote
>
>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]"
><notmyfirstn***@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" <imageinact***@hotmail.com> schreef in bericht
>>news:ab4u52185pp6gls7dstolouqi5rj79tjc7@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]"
>>> <notmyfirstn***@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" <imageinact***@hotmail.com> schreef in bericht
>>>>news:o80u529rqekjmnsovkodtehaatmoqfl7u3@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]"
>>>>> <M***@posseth.com> 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" <imageinact***@hotmail.com> schreef in bericht
>>>>>>news:v92m52lop81o8jginhrgbpqnevpkcsa5nh@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
>>>>>>
>>>>
>>