通过代码控制表格应用 [英] Form application controlling through code

查看:67
本文介绍了通过代码控制表格应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,
我要使用c#控制第三方应用程序.该应用程序运行,我想单击其按钮,然后获取表单的文本框和标签中的内容.请告诉我是否有办法.
感谢您的帮助.
关于

Hi Friends,
I am to control a third party application using c#. the application runs and I want to click its buttons and get what is in text boxes and labels of the form. Please let me know if there is a way around.
Thanks for helping.
Regards

推荐答案

如果该应用程序是.Net应用程序,则可以使用反射来完成所需的操作.

如果不是.net应用程序,您的工作将更加困难.您首先必须学习如何使用Spy ++(或Spy ++ 64位)发现应用程序主窗口的窗口句柄,要操作的表单以及该表单上的所有控件.你想控制.之后,您可以转到 pinvoke.net [ ^ ]以获得需要将值放入其他Windows的Windows API原型.

祝你好运.

If the app is a .Net app, you might be able to use reflection to do what you want.

If it''s NOT a .net app, your job is more difficult. You''re going to first have to learn how to use Spy++ (or Spy++ 64-bit) to discover the window handles for the main window of the app, the form you want to manipulate, and all of the controls on the form that you want to control. After that, you can go to pinvoke.net[^] to get the windows API prototypes you need to put values into other windows.

Good luck with all that.


我假设第三方应用程序指示您要从另一个应用程序/进程内的文本框中检索文本.

这显示了如何监视另一个应用程序的Windows事件
MS Spy ++样式的窗口查找器 [ http://social.msdn.microsoft.com/Forums/zh/vbgeneral/thread/02a67f3a-4a26-4d9a-9c67-0fdff1428a66 [
I assume that by third party application you indicate that you want to retrieve text from text boxes within another application/process.

This shows how you can monitor Windows events of another application
MS Spy++ style Window Finder[^]

Use WM_GETTEXT to retrieve the text

Here is an answer to your question:
http://social.msdn.microsoft.com/Forums/en/vbgeneral/thread/02a67f3a-4a26-4d9a-9c67-0fdff1428a66[^]

Regards
Espen Harlinn


这篇关于通过代码控制表格应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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