Cannot identify controls inside HwndHost window
Posted: Wed Feb 21, 2018 4:45 pm
We have a legacy WinForm app that is being hosted inside a newer WPF app. The WinForm app is run as a separate process, and it's main window is attached as a child to a WPF HwndHost control. Ranorex cannot identify the WinForm window or any of its child controls. I realize this is not a typical design but would appreciate any suggestions.
I reproduced the issue with a small test application. In the attached screenshot the gray window inside the MainWindow is the hosted WinForm window. The screenshot was taken while hovering over the text box control with Ranorex Spy. As you can see, the Spy is identifying the WPF window but nothing inside. I have also attached sample code for analysis.
OS: Windows 7 Enterprise, Service Pack 1
HW: 64-Bit Xeon Processor with 16GB Ram
I reproduced the issue with a small test application. In the attached screenshot the gray window inside the MainWindow is the hosted WinForm window. The screenshot was taken while hovering over the text box control with Ranorex Spy. As you can see, the Spy is identifying the WPF window but nothing inside. I have also attached sample code for analysis.
OS: Windows 7 Enterprise, Service Pack 1
HW: 64-Bit Xeon Processor with 16GB Ram