By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,950 Members | 1,585 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,950 IT Pros & Developers. It's quick & easy.

Add to Favorites / Organize Favorites dialogs

P: n/a
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

Nov 21 '05 #1
Share this Question
Share on Google+
17 Replies


P: n/a
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
Nov 21 '05 #2

P: n/a
"ljlevend2" <lj*******@nospam.nospam> schrieb:
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?


Normally this should work using 'ExecWB' + 'IDM_ADDFAVORITES', but I could
not get it work.

'IDM_ADDFAVORITES' Command ID
<URL:http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/reference/commandids.asp>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

P: n/a
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

Nov 21 '05 #4

P: n/a
Peter,

""Peter Huang" [MSFT]" <v-******@online.microsoft.com> schrieb:
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>" _
)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5

P: n/a
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
Nov 21 '05 #6

P: n/a
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.

Nov 21 '05 #7

P: n/a
> 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

Nov 21 '05 #8

P: n/a
"ljlevend2" <lj*******@nospam.nospam> schrieb:
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.


Are you using .NET 2.0?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #9

P: n/a
Yes, I am using v2.0.

"Herfried K. Wagner [MVP]" wrote:
"ljlevend2" <lj*******@nospam.nospam> schrieb:
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.


Are you using .NET 2.0?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #10

P: n/a
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.

Nov 21 '05 #11

P: n/a
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
""Peter Huang" [MSFT]" wrote:
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.

Nov 21 '05 #12

P: n/a
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.

Nov 21 '05 #13

P: n/a
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.

Nov 21 '05 #14

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

Thanks again!
Lance

Nov 21 '05 #15

P: n/a
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.

Nov 23 '05 #16

P: n/a
That's great. Thanks again!
Lance

Nov 23 '05 #17

P: n/a
Hi

You are welcomed!

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.

Nov 23 '05 #18

This discussion thread is closed

Replies have been disabled for this discussion.