Hi All,
I am launching a IE using following code.
================================================== =====================
m_IeProcess = new Process();
m_IeProcess.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
m_IeProcess = Process.Start("IExplore.exe","www.ABC.com");
================================================== =====================
how do i get refrence to the InternetExplorer from the process.
only way i could do it is by iterating over the all windows as follows
================================================== =============
m_Windows = new ShellWindows();
foreach(InternetExplorer ie in m_Windows)
{
if(ie != null && (IntPtr)ie.HWND ==
m_IeProcess.MainWindowHandle)
{
return ie;
}
}
================================================== =====================
Qustion :
is there a way to get refrence to the internet explorer without using
shell window.
Process class has properties that return Mainwindow handle and caption
etc...but i do not see anything that returns the reference to the main
window itself.
I need the refrence to IE because i want to iterate through the window
object model.
I will be running this code as windows service and shell window does
not work in windows service that why i am looking at other ways to do
this.
SO is there a way to get the refrence to IE from the lauched process
or may be using a windows API that will work in windows service as
well?
Thanks
Siddharth