Re: Open new Internet Explorer window in a new process
- From: "Nathan Jakubiak" <jakubiak@xxxxxxxxxxxx>
- Date: 17 Nov 2006 14:49:25 -0800
Well, I take that back. I was having problems with this a week ago,
but when I came back to it today I was able to create a new process
using CreateProcess AND to sink DWebBrowserEvents2. So go figure.
This brings me to a slightly different question. All of my problems
are solved except one. When I get a NewWindow2 event, I create a new
instance of IWebBrowser2 and return it. I do not want the new window
to get created in a new process, because if I am dealing with a site
that requires cookies, cookie information will not be correct in the
new window. So I use CoCreateInstance when creating a new browser
window for NewWindow2, and but I use CreateProcess when originally
starting the browser.
Now, to the problem. Take the following sequence of steps.
1. Open IE manually.
2. Open IE programatically, using CreateProcess.
3. Get a NewWindow2 event, handle it by creating another browser
window using CoCreateInstance.
4. The browser created in step 3 is created in the IE process opened
in step 1, NOT the process opened in step 2. Any way to force it into
the process created in step 2, so cookies are correct?
On Nov 17, 7:34 am, "Nathan Jakubiak" <jakub...@xxxxxxxxxxxx> wrote:
Any feedback on this issue? Here is where things stand:
1. I can use CreateProcess to create a new instance of IE in a new
process, but then I cannot sink DWebBrowserEvents2 (although maybe I
can inside a BHO?). Actually, I can sink it, but I don't get the
callbacks.
2. I can use CoCreateProcess, but that creates a new instance of IE in
the same process as any running IE instances. In this case I can sink
DWebBrowserEvents2.
I'd like a scenario where I can create a new process AND still sink
DWebBrowserEvents2 without having to have a BHO.
Thanks for any feedback!
On Nov 9, 9:44 am, "Nathan Jakubiak" <jakub...@xxxxxxxxxxxx> wrote:
I guess I should add that the issue I need to solve is when there is
already an IE process running. If one is not running, CoCreateInstance
creates a new one. However, if one is running, it just creates the new
IE window in the same process, which is what I don't want to happen.
On Nov 9, 9:41 am, "Nathan Jakubiak" <jakub...@xxxxxxxxxxxx> wrote:
Hi Peter,
When you say that you get a "new instance", do you mean a new process
is created? If so, that's what I'm looking for! I figured out how to
implement things using CreateProcess, however doing it that way I am
unable to connect to the DWebBrowserEvents2 event sink interface, which
I need to do.
On Nov 9, 5:26 am, peter.isb...@xxxxxxxxx wrote:
Jean-Fabrice RABAUTE skrev:
Nathan Jakubiak a écrit :
I am using CoCreateInstance(CLSID_InternetExplorer, 0, CLSCTX_SERVER,
IID_IWebBrowser2, (LPVOID*)&newIE) to
open up a new browser window and get a handle to its IWebBrowser2
interface. However, if there is an Internet Explorer instance already
running, it opens it in the same process as that running instance. If
I want to force it to open in a new process, and still get a handle to
the IWebBrowser2 interface, how do I do that?
Hi,
You can use "CreateProcess" and launch iexplore.exe process with the url
as argument.
Be sure to check all the arguments as well as the process launched, it
may be a security hole if the process is badly launched.
--
Regards / Cordialement
====================
Jean-Fabrice Rabaute
CORE SERVICES :: Software/Web development & Consulting services
http://www.debugbar.com:Themostadvanced WEB development tool for
Internet Explorer
http://www.core-services.fr-{Enjoy the future today}Hi Jean-Fabrice,
Actually I find it odd that a new instance of IE is not created for
Nathan.
When I test
hr = ::CoCreateInstance (CLSID_InternetExplorer, NULL, CLSCTX_SERVER,
IID_IWebBrowser2, (void**)ppWebBrowser2);
on my computer, it nicely opens a new instance of IE.
Do you really use CreateProcess for opening a new instance of IE?
Could this problem Nathan is having be due to a setting in IE or fixed
in a SP or OS depedent (I've tested on XP SP2 and Win2K SP4).
/Peter
.
- Follow-Ups:
- Re: Open new Internet Explorer window in a new process
- From: Nathan Jakubiak
- Re: Open new Internet Explorer window in a new process
- References:
- Open new Internet Explorer window in a new process
- From: Nathan Jakubiak
- Re: Open new Internet Explorer window in a new process
- From: Jean-Fabrice RABAUTE
- Re: Open new Internet Explorer window in a new process
- From: peter . isberg
- Re: Open new Internet Explorer window in a new process
- From: Nathan Jakubiak
- Re: Open new Internet Explorer window in a new process
- From: Nathan Jakubiak
- Re: Open new Internet Explorer window in a new process
- From: Nathan Jakubiak
- Open new Internet Explorer window in a new process
- Prev by Date: Re: Open new Internet Explorer window in a new process
- Next by Date: Overloading script engine from IHTMLDocument::get_Script
- Previous by thread: Re: Open new Internet Explorer window in a new process
- Next by thread: Re: Open new Internet Explorer window in a new process
- Index(es):
Relevant Pages
|