Re: Open new Internet Explorer window in a new process



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

.



Relevant Pages

  • Re: IE6 doesnt open its own links, sends to another browser
    ... Did you run IE7alongside IE6 recently? ... > the URL in another browser (i.e. if the default browser is Opera, ... > opens in Opera). ... > browse to the link in either the original IE window or the new one. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Opening a new browser
    ... "Sarah" said in news:62e801c42e48$46eb1130$a601280a@phx.gbl: ... What is the web page's URL in which you click a link (which opens ... another browser instance but which closes after 60 seconds)? ... use a script to close that window). ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Open a .pdf in a new window
    ... now, FoxIt Reader, they both have a browser plug in or add on. ... that if you click on a link to a PDF file from a web page the pdf file ... automatically opens in that browser window. ...
    (microsoft.public.publisher.webdesign)
  • Re: Spyware/Malware
    ... we are getting Popup ads on the computer ... >> without any browser window being open first. ... >> and all of a sudden, IE opens to some ad. ...
    (microsoft.public.security)
  • Re: Open new Internet Explorer window in a new process
    ... using CreateProcess AND to sink DWebBrowserEvents2. ... I do not want the new window ... but then I cannot sink DWebBrowserEvents2 (although maybe I ... it opens it in the same process as that running instance. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)