Boern
Boern

Reputation: 7752

InternetExplorer programatically handling popup with C#

I'm using the SHDocVw.InternetExplorer object to navigate through a website programatically using C#. The problem is, that the website is divided in 3 parts, with each part being a separate window/popup:

  1. Login Screen
  2. Confirmation Screen (popup #1)
  3. Actual Application (popup #2)

I'm already using the SHDocVw.InternetExplorer object for enterering the credentials and clicking the login buton on the first screen. But I dont know, how to get a handle to the second-screen (popup #1) in order to be able to click the confirm button on popup #1. Same problem applies for third screen (popup #2). I noticed the IE_NewWindow2-event of SHDocVw.InternetExplorer, but I couldn't figure out how to use it. The first parameter should be according to msdn a new SHDocVw.InternetExplorer object, but it's actually null.

Thank you very much!

Upvotes: 0

Views: 1140

Answers (1)

Sam
Sam

Reputation: 789

you can get a list of the active IE browser and then identify the instance you are looking for by name.

 SHDocVw.ShellWindows Windows = new SHDocVw.ShellWindowsClass();
    foreach (SHDocVw.InternetExplorer ie in Windows)
    {

    }

Upvotes: 2

Related Questions