473,320 Members | 1,839 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
Nov 20 '05 #1
5 3910
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


Nov 20 '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

Nov 20 '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

Nov 20 '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


Nov 20 '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

Nov 20 '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...
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...
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...
0
by: john bailo | last post by:
I am attempting to create a c# program to iterate through the messages in an Outlook/Exchange public folder and extract the headers. My apologies to the VB/VBA groups, but you seem to have more...
2
by: Neil | last post by:
I have an Access 2000 mdb file which opens MS Word docs using automation. Our WAN is somewhat slow, and it takes about six seconds to open Word and the specified document (20 KB) from within Access...
5
by: puff | last post by:
I'm very new to Python and have a question concerning IE automation and detection of page completion. The MSDN article 180366 states in part: ---- The top-level frame fires the...
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
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
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.