Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / July 2004

Tip: Looking for answers? Try searching our database.

Internet Explorer Automation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Adam Stirk - 26 Jul 2004 01:40 GMT
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
Dmitriy Lapshin [C# / .NET MVP] - 26 Jul 2004 08:15 GMT
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!

Signature

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

> Hi,
>
[quoted text clipped - 20 lines]
>
> Adam
Adam Stirk - 26 Jul 2004 17:08 GMT
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;
}
}

> Hi,
>
[quoted text clipped - 31 lines]
> >
> > Adam
Adam Stirk - 26 Jul 2004 17:10 GMT
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;
}
}

> Hi,
>
[quoted text clipped - 31 lines]
> >
> > Adam
Adam Stirk - 26 Jul 2004 10:29 GMT
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

> Hi,
>
[quoted text clipped - 20 lines]
>
> Adam
Adam Stirk - 26 Jul 2004 12:54 GMT
The reason I need to create separate processes is due to session cookies, is
there a way to clear these on each navigate?

> Hi,
>
[quoted text clipped - 20 lines]
>
> Adam

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.