Add to Favorites / Organize Favorites dialogs

G

Guest

I'm implementing the WebBrowser control in my app and I would like to be able
to show the Add to Favorites and Organize Favorites dialogs that are used in
Internet Explorer. Is this possible?

Thanks,
Lance
 
C

Cor Ligthert [MVP]

ljEvend,

Was it you I showed this week the as far as I remember me first and last
(greath) help I ever got from Herfried.

\\\
AxWebBrowser.Navigate("about:<html><body
onload=javascript:window.external.addFavorite('" + textbox1.Text +
"')></body></html>")
///

I hope this helps,

Cor
 
H

Herfried K. Wagner [MVP]

G

Guest

Thanks a lot for the idea. That sounds similar to what I am looking for, but
I could not get it to work. Any other ideas or suggestions?

Thanks again,
Lance
 
P

Peter Huang [MSFT]

Hi

So far the AxWebBrowser1.ExecWB method did not support IDM_ADDFAVORITES. I
think you may try Cor's suggestion

Best regards,

Peter Huang
Microsoft Online Partner Support

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

Herfried K. Wagner [MVP]

Peter,

"Peter Huang" said:
So far the AxWebBrowser1.ExecWB method did not support IDM_ADDFAVORITES.

I didn't find any information in the documentation which states that
'IDM_ADDFAVORITES' is not supported by 'WebBrowser', however, as it doesn't
work it is obviously not supported.
I think you may try Cor's suggestion

ACK. If you do not want to change the URL in the primary webbrowser control
you may want to place a second webbrowser control on the form and prevent
the user from accessing it as shown below:

\\\

' Dummy webbrowser control used to display the favorites dialog.
With Me.AxWebBrowser2
.TabStop = False
.Size = New Size(0, 0)
End With
Me.AxWebBrowser1.Navigate("http://dotnet.mvps.org/dotnet/")
..
..
..
Me.AxWebBrowser2.Navigate( _
"about:<html><head></head>" & _
"<body onload=""javascript:window.external.addFavorite('" & _
Me.AxWebBrowser1.LocationURL & _
"');""></body></html>" _
)
///
 
C

Cor Ligthert [MVP]

Peter,
think you may try Cor's suggestion

I think that Herfried did not see that it is his sollution, therefore you
did probably of course mean.

"Think you may try Cor's suggestion to use Herfrieds solution showed in far
past to Cor".

Although I agree with you probably as well that this is very confusing for
the OP.

:)))

Cor
 
P

Peter Huang [MSFT]

Hi

Thank's Herfried and Cor's reply.
I am sorry I did not make it clear, I do not mean IWebBrowser2 unmanged
interface did not support IDM_ADDFAVORITES.
I means the AxWebrowser managed Wrap did not have the option
IDM_ADDFAVORITES, if we use VB.NET with ExecWB, the intellisence will popup
a list which did not include the IDM_ADDFAVORITES.

Best regards,

Peter Huang
Microsoft Online Partner Support

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

Guest

ACK. If you do not want to change the URL in the primary webbrowser control
you may want to place a second webbrowser control on the form and prevent
the user from accessing it as shown below:

It looks like that should work, but unfortunately I do not know how to
create the AxWebBrowser. I am only familiar with the
Windows.Forms.WebBrowser control. If you could help me with this I think I
would be in good shape.

Thanks again,
Lance
 
H

Herfried K. Wagner [MVP]

ljlevend2 said:
It looks like that should work, but unfortunately I do not know how to
create the AxWebBrowser. I am only familiar with the
Windows.Forms.WebBrowser control. If you could help me with this I think
I
would be in good shape.

Are you using .NET 2.0?
 
P

Peter Huang [MSFT]

Hi

In 2.0, we have wrap the WebBrowser control as a buildin control, we do not
try to generate the AxWebBrowser via COM Interop, just use the WebBrowser
control.

Best regards,

Peter Huang
Microsoft Online Partner Support

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

Guest

Thanks. I am using the WebBrowser control in v2.0. The problem is that I
don't see things like ExecWB or IDM_ADDFAVORITES. I also tried the following
example from Herfried for showing favorites, but that didn't work (which I
assume is because I was using the WebBrowser control in v2.0 rather than
AxWebBrowser).

Me.AxWebBrowser2.Navigate( _
"about:<html><head></head>" & _
"<body onload=""javascript:window.external.addFavorite('" & _
Me.AxWebBrowser1.LocationURL & _
"');""></body></html>" _
)

So, I guess what I need to know is how to show the Add to Favorites and
Organize Favorites dialogs when using the WebBrowser control in v2.0.

Thanks again!
Lance
 
P

Peter Huang [MSFT]

Hi,

Currently I am researching the issue and we will reply here with more
information as soon as possible.
If you have any more concerns on it, please feel free to post here.

Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

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

Peter Huang [MSFT]

Hi

Based on my research, I think you may to add a COM reference to the dll
below from the ToolBox(just as you do with an ocx) and you will get the
AxWebBrowser.
c:\WINDOWS\system32\shdocvw.dll

And then you can use the Cor's suggestion that use the code below to add
fav.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.AxWebBrowser1.Navigate( _
"about:<html><head></head>" & _
"<body onload=""javascript:window.external.addFavorite('" & _
Me.AxWebBrowser1.LocationURL & _
"');""></body></html>" _
)
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Me.AxWebBrowser1.Navigate("www.google.com")
End Sub

Best regards,

Peter Huang
Microsoft Online Partner Support

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

Guest

That is great! Thanks a lot. Do you know if there is a similar way to show
the Organize Favorites dialog?

Thanks again!
Lance
 
P

Peter Huang [MSFT]

Hi

You can use the similar ways.
Me.AxWebBrowser1.Navigate( _
"about:<html><head></head>" & _
"<body
onload=""javascript:window.external.ShowBrowserUI('OrganizeFavorites',null);
""></body></html>" _
)


Best regards,

Peter Huang
Microsoft Online Partner Support

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top