To get data from a 3rd party application that is written in Qt. I need to iterate what looks like a QTreeList, but the application doesn't expose these qwidget's as native windows.
If this isn't possible with the normal WinAPI, I'm guessing I will have to go to a lower level to be able to extract this information.
The top level window has a handler. If you're able to calculate offsets of widgets you need to access from the top level window, you can send input events there.
One way could be to inject some code to Qt and run the application against your modified Qt. I assume this is the way for example Squish works.
J-P Nurmi
The easiest way would be to run the application against a Qt that doesn't support "aliens" at all. This way the application would possibly run slower but all widgets would have real handles. I'm also wondering if there is a commandline switch disabling aliens completely for an application (turning on the opengl rendering system could also do it as opengl needs real handles, as far as I remember).
Found it. The QT_USE_NATIVE_WINDOWS environment variable must be set to a positive integer.
I also implemented an application that injects a dll I made into the Qt application, and I am able to convert the HWND to QWidget*, cast it to the proper control and use it as necessary. The dll locks up the application when I call QMessageBox::information(), so I guess something with the event loop processing isn't working correctly.
You can't inject objects (such as events) into the other application because of different address spaces. The only thing you may do is to implement a "server" dll that can be instrumented from outside of the process (i.e. using a socket or a pipe) to do tasks from inside the process address space.
Bookmarks