C#如何通过C#代码扩展treenode,treenode在另一个应用程序上 [英] C# how to expand treenode through C# code, treenode is on another application

查看:158
本文介绍了C#如何通过C#代码扩展treenode,treenode在另一个应用程序上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在为将运行另一个Windows应用程序的工具进行编码.我成功地抓住了窗户的所有把手及其控件.窗口有一个树形视图,我想扩展该树形视图并单击一个特定的节点,这样我就可以看到其子节点.

在C#中,有没有人对此有解决方案?

请注意,我可以捕捉到树视图的汉德.

谢谢.

Hi

I am coding for a tool which will operate another windows application. I got success to catch all the handles of windows and its control. The windows has a treeview and I want to expand that treeview and click on a particular node so i can see its child nodes.

Does any one have solution for this in C#?

Please note that I can catch hanlde of the treeview.

Thanks.

推荐答案

您正在尝试提出一个严重的问题.这完全取决于该应用程序.通常,除非您拥有要控制的应用程序的源代码或此应用程序支持某些可访问性API,否则您几乎无法获得可靠的结果.

即使您要控制应用程序的源代码,将其转换为库并将其直接集成到您的流程中也要好得多.通常,除非单独设计一个单独的过程以这种方式使用,否则集成一个单独的过程是一件很糟糕的事情.

一些尝试模拟键盘/鼠标用户输入(这很有可能),以直接使用要控制的应用程序的UI并获得一些结果.这是肮脏的东西,永远不可能100%可靠.忘记维护这种解决方案".我什至不建议尝试.

—SA
You are trying to pose a bad problem. It totally depends on that application; in general case, you hardly can get reliable results unless you have a source code of the application to be controlled or this application supports some accessibility API.

Even if you have a source code of the application to be controlled, it would be much better to convert it to a library and integrate it directly into your process. Generally, integration of a separate process is a really bad thing unless it is specifically designed to be used in this way.

Some try to simulate keyboard/mouse user input (which is quite possible) to directly use the UI of the application to be controlled and get some results. This is dirty thing which never can be 100% reliable; forget about maintenance of such "solution". I would not even recommend to try.

—SA


这篇关于C#如何通过C#代码扩展treenode,treenode在另一个应用程序上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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