Discussion:
Passing a URL to an open browser
(too old to reply)
Jim
2007-10-19 18:55:00 UTC
Permalink
I need to pass a URL to an open browser without closing the current browser
in I.E. 5.

How can I do that from outside of the browser? I'm getting the new URL from
an outside app.

Thanks,

Jim
Sheng Jiang[MVP]
2007-10-19 20:57:22 UTC
Permalink
http://msdn2.microsoft.com/en-us/library/aa194106(office.11).aspx
--
Sheng Jiang
Microsoft MVP in VC++
Post by Jim
I need to pass a URL to an open browser without closing the current browser
in I.E. 5.
How can I do that from outside of the browser? I'm getting the new URL from
an outside app.
Thanks,
Jim
Vladimir Scherbina [MVP]
2007-10-21 14:43:14 UTC
Permalink
The way you suggested will create a new instance of browser. I suppose, OP
wants to avoid this.

In order to open url in an existing browse, one will need to get the list of
open shell windows, for example, via ShellWindows object. Once you get the
list, you can choose, what IWebBrowser item you wish to use, and then make a
navigation into a needed URL.

--Vladimir
Post by Sheng Jiang[MVP]
http://msdn2.microsoft.com/en-us/library/aa194106(office.11).aspx
--
Sheng Jiang
Microsoft MVP in VC++
Post by Jim
I need to pass a URL to an open browser without closing the current
browser
Post by Jim
in I.E. 5.
How can I do that from outside of the browser? I'm getting the new URL
from
Post by Jim
an outside app.
Thanks,
Jim
Sheng Jiang[MVP]
2007-10-22 21:13:50 UTC
Permalink
I wrote an article (www.codeproject.com/shell/AutomateShellWindow.asp) about
this, however it has problem with vista's UAC
(http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1253015&SiteID=1), so
I don't suggest it.

Better to control the IE instance created by your process, than to control
someone else's.
--
Sheng Jiang
Microsoft MVP in VC++
Post by Vladimir Scherbina [MVP]
The way you suggested will create a new instance of browser. I suppose, OP
wants to avoid this.
In order to open url in an existing browse, one will need to get the list of
open shell windows, for example, via ShellWindows object. Once you get the
list, you can choose, what IWebBrowser item you wish to use, and then make a
navigation into a needed URL.
--Vladimir
Post by Sheng Jiang[MVP]
http://msdn2.microsoft.com/en-us/library/aa194106(office.11).aspx
--
Sheng Jiang
Microsoft MVP in VC++
Post by Jim
I need to pass a URL to an open browser without closing the current
browser
Post by Jim
in I.E. 5.
How can I do that from outside of the browser? I'm getting the new URL
from
Post by Jim
an outside app.
Thanks,
Jim
Jim
2007-10-22 21:31:01 UTC
Permalink
Thanks for the input.

Opening our own instance of a browser is a problem in our environment. We do
not want any additional windows opened on the client workstation. The I.E.
instance is created when the user logs in in the morning and is not shut down
till the end of the day. The user never leaves that browser instance once
it's created. Because of that we need to interact with the client browser
directly and not instanciate a new instance. We need to direct the
client/user to a specific page on our site automatically and include data
specific to the outside programs passed values.

Thanks
Post by Sheng Jiang[MVP]
I wrote an article (www.codeproject.com/shell/AutomateShellWindow.asp) about
this, however it has problem with vista's UAC
(http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1253015&SiteID=1), so
I don't suggest it.
Better to control the IE instance created by your process, than to control
someone else's.
--
Sheng Jiang
Microsoft MVP in VC++
Post by Vladimir Scherbina [MVP]
The way you suggested will create a new instance of browser. I suppose, OP
wants to avoid this.
In order to open url in an existing browse, one will need to get the list
of
Post by Vladimir Scherbina [MVP]
open shell windows, for example, via ShellWindows object. Once you get the
list, you can choose, what IWebBrowser item you wish to use, and then make
a
Post by Vladimir Scherbina [MVP]
navigation into a needed URL.
--Vladimir
Post by Sheng Jiang[MVP]
http://msdn2.microsoft.com/en-us/library/aa194106(office.11).aspx
--
Sheng Jiang
Microsoft MVP in VC++
Post by Jim
I need to pass a URL to an open browser without closing the current
browser
Post by Jim
in I.E. 5.
How can I do that from outside of the browser? I'm getting the new URL
from
Post by Jim
an outside app.
Thanks,
Jim
Vladimir Scherbina
2007-10-23 07:54:46 UTC
Permalink
Make sure you get the correct instance object, because ShellWindows
enumerates open shell windows as well. For example, the user might open
C:\Program Files\ folder in a shell window, and you will navigate it into a
desired URL which is not what user actually wants.
Post by Jim
Thanks for the input.
Opening our own instance of a browser is a problem in our environment. We do
not want any additional windows opened on the client workstation. The I.E.
instance is created when the user logs in in the morning and is not shut down
till the end of the day. The user never leaves that browser instance once
it's created. Because of that we need to interact with the client browser
directly and not instanciate a new instance. We need to direct the
client/user to a specific page on our site automatically and include data
specific to the outside programs passed values.
Thanks
Post by Sheng Jiang[MVP]
I wrote an article (www.codeproject.com/shell/AutomateShellWindow.asp) about
this, however it has problem with vista's UAC
(http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1253015&SiteID=1), so
I don't suggest it.
Better to control the IE instance created by your process, than to control
someone else's.
--
Sheng Jiang
Microsoft MVP in VC++
Post by Vladimir Scherbina [MVP]
The way you suggested will create a new instance of browser. I suppose, OP
wants to avoid this.
In order to open url in an existing browse, one will need to get the list
of
Post by Vladimir Scherbina [MVP]
open shell windows, for example, via ShellWindows object. Once you get the
list, you can choose, what IWebBrowser item you wish to use, and then make
a
Post by Vladimir Scherbina [MVP]
navigation into a needed URL.
--Vladimir
Post by Sheng Jiang[MVP]
http://msdn2.microsoft.com/en-us/library/aa194106(office.11).aspx
--
Sheng Jiang
Microsoft MVP in VC++
Post by Jim
I need to pass a URL to an open browser without closing the current
browser
Post by Jim
in I.E. 5.
How can I do that from outside of the browser? I'm getting the new URL
from
Post by Jim
an outside app.
Thanks,
Jim
Jim
2007-10-25 15:34:04 UTC
Permalink
That would have ticked off my user community, thanks
Post by Vladimir Scherbina
Make sure you get the correct instance object, because ShellWindows
enumerates open shell windows as well. For example, the user might open
C:\Program Files\ folder in a shell window, and you will navigate it into a
desired URL which is not what user actually wants.
Post by Jim
Thanks for the input.
Opening our own instance of a browser is a problem in our environment. We do
not want any additional windows opened on the client workstation. The I.E.
instance is created when the user logs in in the morning and is not shut down
till the end of the day. The user never leaves that browser instance once
it's created. Because of that we need to interact with the client browser
directly and not instanciate a new instance. We need to direct the
client/user to a specific page on our site automatically and include data
specific to the outside programs passed values.
Thanks
Post by Sheng Jiang[MVP]
I wrote an article (www.codeproject.com/shell/AutomateShellWindow.asp) about
this, however it has problem with vista's UAC
(http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1253015&SiteID=1), so
I don't suggest it.
Better to control the IE instance created by your process, than to control
someone else's.
--
Sheng Jiang
Microsoft MVP in VC++
Post by Vladimir Scherbina [MVP]
The way you suggested will create a new instance of browser. I suppose, OP
wants to avoid this.
In order to open url in an existing browse, one will need to get the list
of
Post by Vladimir Scherbina [MVP]
open shell windows, for example, via ShellWindows object. Once you get the
list, you can choose, what IWebBrowser item you wish to use, and then make
a
Post by Vladimir Scherbina [MVP]
navigation into a needed URL.
--Vladimir
Post by Sheng Jiang[MVP]
http://msdn2.microsoft.com/en-us/library/aa194106(office.11).aspx
--
Sheng Jiang
Microsoft MVP in VC++
Post by Jim
I need to pass a URL to an open browser without closing the current
browser
Post by Jim
in I.E. 5.
How can I do that from outside of the browser? I'm getting the new URL
from
Post by Jim
an outside app.
Thanks,
Jim
Sheng Jiang[MVP]
2007-10-25 00:17:04 UTC
Permalink
In this case have a background app to open a browser window during the
startup and use inter-process communication to tell the background app how
to interact with the browser instance in your application.
--
Sheng Jiang
Microsoft MVP in VC++
Post by Jim
Thanks for the input.
Opening our own instance of a browser is a problem in our environment. We do
not want any additional windows opened on the client workstation. The I.E.
instance is created when the user logs in in the morning and is not shut down
till the end of the day. The user never leaves that browser instance once
it's created. Because of that we need to interact with the client browser
directly and not instanciate a new instance. We need to direct the
client/user to a specific page on our site automatically and include data
specific to the outside programs passed values.
Thanks
Post by Sheng Jiang[MVP]
I wrote an article (www.codeproject.com/shell/AutomateShellWindow.asp) about
this, however it has problem with vista's UAC
(http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1253015&SiteID=1), so
Post by Jim
Post by Sheng Jiang[MVP]
I don't suggest it.
Better to control the IE instance created by your process, than to control
someone else's.
--
Sheng Jiang
Microsoft MVP in VC++
Post by Vladimir Scherbina [MVP]
The way you suggested will create a new instance of browser. I suppose, OP
wants to avoid this.
In order to open url in an existing browse, one will need to get the list
of
Post by Vladimir Scherbina [MVP]
open shell windows, for example, via ShellWindows object. Once you get the
list, you can choose, what IWebBrowser item you wish to use, and then make
a
Post by Vladimir Scherbina [MVP]
navigation into a needed URL.
--Vladimir
Post by Sheng Jiang[MVP]
http://msdn2.microsoft.com/en-us/library/aa194106(office.11).aspx
--
Sheng Jiang
Microsoft MVP in VC++
Post by Jim
I need to pass a URL to an open browser without closing the current
browser
Post by Jim
in I.E. 5.
How can I do that from outside of the browser? I'm getting the new URL
from
Post by Jim
an outside app.
Thanks,
Jim
Jim
2007-10-25 15:33:01 UTC
Permalink
good point, thanks I'll give it a try.
Post by Sheng Jiang[MVP]
In this case have a background app to open a browser window during the
startup and use inter-process communication to tell the background app how
to interact with the browser instance in your application.
--
Sheng Jiang
Microsoft MVP in VC++
Post by Jim
Thanks for the input.
Opening our own instance of a browser is a problem in our environment. We
do
Post by Jim
not want any additional windows opened on the client workstation. The I.E.
instance is created when the user logs in in the morning and is not shut
down
Post by Jim
till the end of the day. The user never leaves that browser instance once
it's created. Because of that we need to interact with the client browser
directly and not instanciate a new instance. We need to direct the
client/user to a specific page on our site automatically and include data
specific to the outside programs passed values.
Thanks
Post by Sheng Jiang[MVP]
I wrote an article (www.codeproject.com/shell/AutomateShellWindow.asp)
about
Post by Jim
Post by Sheng Jiang[MVP]
this, however it has problem with vista's UAC
(http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1253015&SiteID=1), so
Post by Jim
Post by Sheng Jiang[MVP]
I don't suggest it.
Better to control the IE instance created by your process, than to
control
Post by Jim
Post by Sheng Jiang[MVP]
someone else's.
--
Sheng Jiang
Microsoft MVP in VC++
Post by Vladimir Scherbina [MVP]
The way you suggested will create a new instance of browser. I
suppose, OP
Post by Jim
Post by Sheng Jiang[MVP]
Post by Vladimir Scherbina [MVP]
wants to avoid this.
In order to open url in an existing browse, one will need to get the
list
Post by Jim
Post by Sheng Jiang[MVP]
of
Post by Vladimir Scherbina [MVP]
open shell windows, for example, via ShellWindows object. Once you get
the
Post by Jim
Post by Sheng Jiang[MVP]
Post by Vladimir Scherbina [MVP]
list, you can choose, what IWebBrowser item you wish to use, and then
make
Post by Jim
Post by Sheng Jiang[MVP]
a
Post by Vladimir Scherbina [MVP]
navigation into a needed URL.
--Vladimir
Post by Sheng Jiang[MVP]
http://msdn2.microsoft.com/en-us/library/aa194106(office.11).aspx
--
Sheng Jiang
Microsoft MVP in VC++
Post by Jim
I need to pass a URL to an open browser without closing the current
browser
Post by Jim
in I.E. 5.
How can I do that from outside of the browser? I'm getting the new
URL
Post by Jim
Post by Sheng Jiang[MVP]
Post by Vladimir Scherbina [MVP]
Post by Sheng Jiang[MVP]
from
Post by Jim
an outside app.
Thanks,
Jim
Continue reading on narkive:
Loading...