只有过程时如何查找字段的值 [英] How to find the value of a field when you only have the Process

查看:102
本文介绍了只有过程时如何查找字段的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试读取程序中字段的值,以便可以(以编程方式)将其添加到Excel电子表格中.我已经使用System.Diagnostics.Process来找到所需的过程,并且可以找到我的窗口(我已经使用ThinkOrSwim和Excel进行了尝试),但是我无法获取其中的每个字段的值这些应用中的任何一个.我已经找到了很多有关如何获取子窗口的示例,但是Excel和ThinkOrSwim的句柄都为零.如何访问从流程开始的Window上的字段(或是否有其他方法)?

谢谢,

Cecilia

Hi,

I''m trying to read the value of a field in a program so that I can add it (programatically) to an excel spreadsheet. I''ve used System.Diagnostics.Process to find the process that I want, and I can find my window (I''ve tried both with ThinkOrSwim and Excel), but I can''t get the value of each field in either of these apps. I''ve found lots of examples on how to get child windows, but the handle comes back as zero for both Excel and ThinkOrSwim. How do I access the fields on a Window starting from a Process (or if there is any other way of doing it)?

Thanks,

Cecilia

推荐答案

两种解决方案:
1.如果您可以访问要获取字段值的应用程序代码,则将字段值输出到某个地方(文件,注册表等)然后获取信息的方法要容易得多.

2.如果您无法访问应用程序的代码,则需要使用非托管的挂钩代码.机制是获取现场控制的句柄并设置消息以获取信息.
Two solutions:
1. if you can access the application''s code of which you want to get the field value, it is much easier way to output the field value to somewhere (file, registry and etc) and then achieve the information.

2. if you cannot access the application''s code, then you need to use unmanaged hook code. The mechanisim is to gain the handle of the field control and set the message to achieve the information.


这篇关于只有过程时如何查找字段的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆