'Interact with Internet Explorer find window from code behind

We have a WPF application that uses a System.Windows.Controls.WebBrowser control embedded in the window to link to our intranet. The application is used on our EPOS units running Windows 10 LTSB. This limits us to using Internet Explorer only. As there are no keyboards attached, we use a WPF keyboard integrated into the application and send keypresses using InputSimulator.SimulateKeyPress(VirtualKeyCode).

All of this works extremely well and has been used for several years now.

However, we are wanting to add text search functionality to the application. The easiest way we thought of utilising this was to send a CTRL-F to the browser to open the browser find window. The problem we have with this is that Internet Explorer creates a new window for find, this floats externally to our application so we cannot gain focus on it while using our on-screen keyboard.

What I think I need to do is to get a handle to this new window so, when processing key presses, we can direct them somehow to the find window, but I have no idea of how to achieve this!

Can anyone please help?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source