Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on automation on IE 8 for one application. I am trying to get the second IE window which is opened from first window. But in ShellWindows I am getting only the first window. Herewith the code I am using:

C#
InternetExplorer IE = null;
ShellWindows m_IEFoundBrowsers = new ShellWindowsClass();
foreach (InternetExplorer Browser in m_IEFoundBrowsers)
{
Logger.Log("Hi I am StatusText :" + Browser.StatusText + ", Url name : " + Browser.LocationURL + ", HWND : " + Browser.HWND);
if (Browser.HWND == IEPtr.ToInt32())
{
     IE = Browser;
     break;
}
}
if (IE == null)
          throw new Exception("Error in creating Internet explorer instance");


But it seems I am not getting the second window (Browser.HWND). I have run the same code in other system and its working fine. I was just wondering is there any IE setting which i am missing in my system.

Thanks in advance.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900