简体   繁体   中英

How to get information about contents of Qt listbox in another process

I got an application written using Qt and I would like to read data in Qt listbox. It doesnt respond to LB_GETTEXT or other windows messages, is there a good way to get data from it from another process?

I have no access to Qt process, its external program. I am looking for a way to access LB contents from C#.

As it turns out there is Accessibility plugin for Qt that is supposed to provide support for required operations. However I am noob with QT and its unclear to me whether application has to be build with accessibility allowed or its a feature that can be turned on and off for any application ( or at least default build applicaiton, with accessibility not being disabled explicitly).

I have read and it says you need to run export QT_ACCESSIBILITY=1, place qt.conf file and put accessible folder to Qt app in main root. I think I dont understand completely how to turn QT_ACCESSIBILITY=1 and whever it should be enough for application to become accessible. ive added QT_ACCESSIBILITY=1 into environment variables in my computer properties, should that do the trick? Or export QT_ACCESSIBILITY=1 is something different.

Thanks

您可能希望将进程间通信用于以下目的: http//doc.qt.io/archives/qt-4.7/ipc.html

You can't easily do that, since Qt doesn't use standard Windows controls to implement it's widgets, thus you can't easily access it's contents using standard Windows Api methods(functions/messages/windows ipc). You will need to somehow hack trough it's memory(not really recommended) or use some gui (testing) automation tool that supports Qt like Squish .

LE: You might also want to check this hack by forcing the loading of Qt Accessible Plug-in into the application and then trying to inspect using usual tools like Microsoft's Spy++ included in Visual Studio. See 1 and 2 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM