473,386 Members | 1,705 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,386 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 5394
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.