473,320 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Internet Explorer Automation

Hi,

I have a application that I need to create multiple new "iexplore.exe"
processes (show more than once in taskmanger) and control them using the
shdocvw/mshtml.

I am able control Internet Explorer with instances created with the shdocvw.
e.g.
Activator.CreateInstance(Type.GetTypeFromProgID
("InternetExplorer.Application");

And I am able to create the new "iexplore.exe" processes. e.g.
System.Diagnostics.Process.Start("iexplore.exe");

The problem I am having is creating the Internet Explorer with
Process.Start() and being able to control it using the shdocvw/mshtml
libraries.

Is there a way I can use the process id of the started "iexplore.exe" and
turn it into the IWebBrowser2 interface?

Many thanks in advance

Adam
Jul 21 '05 #1
5 5390
Hi,

First, sorry for a rather vague answer. From what I remember, there is a
custom window message allowing to obtain the Web browser interface when
being sent to an IE window. So your task will be to determine one of the
top-level windows of an "iexplore.exe" instance in question, and then to
send the custom message to that window, obtaining a 32-bit pointer to the
interface and then marshalling it to the managed space. So I welcome experts
on interop and IE to add necessary details!

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Adam Stirk" <.> wrote in message
news:41***********************@ptn-nntp-reader01.plus.net...
Hi,

I have a application that I need to create multiple new "iexplore.exe"
processes (show more than once in taskmanger) and control them using the
shdocvw/mshtml.

I am able control Internet Explorer with instances created with the shdocvw. e.g.
Activator.CreateInstance(Type.GetTypeFromProgID
("InternetExplorer.Application");

And I am able to create the new "iexplore.exe" processes. e.g.
System.Diagnostics.Process.Start("iexplore.exe");

The problem I am having is creating the Internet Explorer with
Process.Start() and being able to control it using the shdocvw/mshtml
libraries.

Is there a way I can use the process id of the started "iexplore.exe" and
turn it into the IWebBrowser2 interface?

Many thanks in advance

Adam


Jul 21 '05 #2
I am also open to suggestion on how I could create a new "iexplore.exe"
process by using the shdocvw library, if this is at all possible.

Regards

Adam
"Adam Stirk" <.> wrote in message
news:41***********************@ptn-nntp-reader01.plus.net...
Hi,

I have a application that I need to create multiple new "iexplore.exe"
processes (show more than once in taskmanger) and control them using the
shdocvw/mshtml.

I am able control Internet Explorer with instances created with the shdocvw. e.g.
Activator.CreateInstance(Type.GetTypeFromProgID
("InternetExplorer.Application");

And I am able to create the new "iexplore.exe" processes. e.g.
System.Diagnostics.Process.Start("iexplore.exe");

The problem I am having is creating the Internet Explorer with
Process.Start() and being able to control it using the shdocvw/mshtml
libraries.

Is there a way I can use the process id of the started "iexplore.exe" and
turn it into the IWebBrowser2 interface?

Many thanks in advance

Adam

Jul 21 '05 #3
The reason I need to create separate processes is due to session cookies, is
there a way to clear these on each navigate?

"Adam Stirk" <.> wrote in message
news:41***********************@ptn-nntp-reader01.plus.net...
Hi,

I have a application that I need to create multiple new "iexplore.exe"
processes (show more than once in taskmanger) and control them using the
shdocvw/mshtml.

I am able control Internet Explorer with instances created with the shdocvw. e.g.
Activator.CreateInstance(Type.GetTypeFromProgID
("InternetExplorer.Application");

And I am able to create the new "iexplore.exe" processes. e.g.
System.Diagnostics.Process.Start("iexplore.exe");

The problem I am having is creating the Internet Explorer with
Process.Start() and being able to control it using the shdocvw/mshtml
libraries.

Is there a way I can use the process id of the started "iexplore.exe" and
turn it into the IWebBrowser2 interface?

Many thanks in advance

Adam

Jul 21 '05 #4
I have managed to find a solution to my problem. Here is my solution.

Process m_Proc = Process.Start("IExplore.exe");

InternetExplorer m_IEBrowser = null;
ShellWindows m_IEFoundBrowsers = new ShellWindowsClass();
foreach(InternetExplorer Browser in m_IEFoundBrowsers)
{
if(Browser.HWND == (int)m_Proc.MainWindowHandle)
{
m_IEBrowser = Browser;
break;
}
}

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

First, sorry for a rather vague answer. From what I remember, there is a
custom window message allowing to obtain the Web browser interface when
being sent to an IE window. So your task will be to determine one of the
top-level windows of an "iexplore.exe" instance in question, and then to
send the custom message to that window, obtaining a 32-bit pointer to the
interface and then marshalling it to the managed space. So I welcome experts on interop and IE to add necessary details!

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Adam Stirk" <.> wrote in message
news:41***********************@ptn-nntp-reader01.plus.net...
Hi,

I have a application that I need to create multiple new "iexplore.exe"
processes (show more than once in taskmanger) and control them using the
shdocvw/mshtml.

I am able control Internet Explorer with instances created with the

shdocvw.
e.g.
Activator.CreateInstance(Type.GetTypeFromProgID
("InternetExplorer.Application");

And I am able to create the new "iexplore.exe" processes. e.g.
System.Diagnostics.Process.Start("iexplore.exe");

The problem I am having is creating the Internet Explorer with
Process.Start() and being able to control it using the shdocvw/mshtml
libraries.

Is there a way I can use the process id of the started "iexplore.exe" and turn it into the IWebBrowser2 interface?

Many thanks in advance

Adam


Jul 21 '05 #5
I have managed to find a solution to my problem. Here is my solution.

Process m_Proc = Process.Start("IExplore.exe");

InternetExplorer m_IEBrowser = null;
ShellWindows m_IEFoundBrowsers = new ShellWindowsClass();
foreach(InternetExplorer Browser in m_IEFoundBrowsers)
{
if(Browser.HWND == (int)m_Proc.MainWindowHandle)
{
m_IEBrowser = Browser;
break;
}
}
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

First, sorry for a rather vague answer. From what I remember, there is a
custom window message allowing to obtain the Web browser interface when
being sent to an IE window. So your task will be to determine one of the
top-level windows of an "iexplore.exe" instance in question, and then to
send the custom message to that window, obtaining a 32-bit pointer to the
interface and then marshalling it to the managed space. So I welcome experts on interop and IE to add necessary details!

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Adam Stirk" <.> wrote in message
news:41***********************@ptn-nntp-reader01.plus.net...
Hi,

I have a application that I need to create multiple new "iexplore.exe"
processes (show more than once in taskmanger) and control them using the
shdocvw/mshtml.

I am able control Internet Explorer with instances created with the

shdocvw.
e.g.
Activator.CreateInstance(Type.GetTypeFromProgID
("InternetExplorer.Application");

And I am able to create the new "iexplore.exe" processes. e.g.
System.Diagnostics.Process.Start("iexplore.exe");

The problem I am having is creating the Internet Explorer with
Process.Start() and being able to control it using the shdocvw/mshtml
libraries.

Is there a way I can use the process id of the started "iexplore.exe" and turn it into the IWebBrowser2 interface?

Many thanks in advance

Adam

Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: mic | last post by:
I'm currently trying to write an MSIE automation software and have run into such problem - have no idea how to take control of external popup windows - I use WebBrowser COM object and am able to...
0
by: asadhussain | last post by:
I wrote a plugin to internet explorer that requires internet explorer to be shutdown and restarted. I figured out a way to shut down IE using the MSI and to start it back up using VBScript. I...
6
by: tinkerman | last post by:
Hello net friends, I need to automate Internet Explorer in a very simple way. I need to: 1. press refresh (F5) on the currently loaded website. 2. press END button. 3. Click a button...
5
by: Adam Stirk | last post by:
Hi, I have a application that I need to create multiple new "iexplore.exe" processes (show more than once in taskmanger) and control them using the shdocvw/mshtml. I am able control Internet...
3
by: VK | last post by:
Internet Explorer 7 beta 2 preview CNET Editor review: <http://reviews.cnet.com/Internet_Explorer_7_for_XP_SP2_Beta_2/4505-3514_7-31454661-2.html?tag=nl.e415> Summary (my personal review...
2
by: pigeonrandle | last post by:
Hi, Does anyone know how get text from/ set text to 'child windows' of an Internet Explorer Server class window? Using WM_SETTEXT would be great, but i don't know how to get the handle of a child...
1
by: Frederik Vanderhaegen | last post by:
Hi, I'm writing an application which handles Internet Explorer Automation. Through the application I'm able to automate logon on a certain webpage. When I automate the click on the logon button,...
0
by: vbcoder86 | last post by:
Hi All, I have an excel macro that I'm running. The code does everything I want except that after about 200 iterations VB will run out of memory and I'll get an "automation error". I'm using the...
0
by: Ajay Zambad | last post by:
Hi, i am able to connect internet explorer using Excel macro but not getting that how to connect the options like (Upload, Brows, insert) into IE using macro. Regards, Ajay
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.