简体   繁体   English

如何在另一个进程中获取有关Qt列表框内容的信息

[英]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. 我有一个使用Qt编写的应用程序,我想读取Qt列表框中的数据。 It doesnt respond to LB_GETTEXT or other windows messages, is there a good way to get data from it from another process? 它没有响应LB_GETTEXT或其他Windows消息,是否有一种从另一个进程获取数据的好方法?

I have no access to Qt process, its external program. 我没有访问Qt进程,它的外部程序。 I am looking for a way to access LB contents from C#. 我正在寻找一种从C#访问LB内容的方法。

As it turns out there is Accessibility plugin for Qt that is supposed to provide support for required operations. 事实证明,Qt的Accessibility插件应该为所需的操作提供支持。 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). 但是,我对QT不感兴趣并且我不清楚应用程序是否必须使用允许的可访问性构建,或者它的功能可以为任何应用程序打开和关闭(或至少是默认构建应用程序,可访问性未被明确禁用)。

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. 我已阅读并说它需要运行导出QT_ACCESSIBILITY = 1,放置qt.conf文件并将可访问文件夹放入主根目录中的Qt应用程序。 I think I dont understand completely how to turn QT_ACCESSIBILITY=1 and whever it should be enough for application to become accessible. 我想我完全不明白如何将QT_ACCESSIBILITY = 1,并且应该足以让应用程序变得可访问。 ive added QT_ACCESSIBILITY=1 into environment variables in my computer properties, should that do the trick? 我已经将QT_ACCESSIBILITY = 1添加到我的计算机属性中的环境变量中,如果这样做的话? Or export QT_ACCESSIBILITY=1 is something different. 或者导出QT_ACCESSIBILITY = 1是不同的。

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). 你不能轻易做到这一点,因为Qt不使用标准的Windows控件来实现它的小部件,因此你无法使用标准的Windows Api方法(函数/消息/ 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 . 你需要以某种方式破解它的内存(不是真的推荐)或使用支持Qt的一些gui(测试)自动化工具,如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. LE:您可能还想通过强制将Qt Accessible Plug-in加载到应用程序中然后尝试使用Visual Studio中包含的Microsoft的Spy ++等常用工具进行检查来检查此hack。 See 1 and 2 . 12

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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