使用C#控制另一个应用程序中的另一种形式 [英] Control another form in another application with c#

查看:108
本文介绍了使用C#控制另一个应用程序中的另一种形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道我可以控制在另一个应用程序中的另一种形式吗?
例如其他应用程序中的 textBox 按钮.
我可以吗?

I want to know can I control another form in another application ?
like the textBox in other application or the button.
Can I ???

推荐答案

否,因此您不能.会有安全性和其他问题.
No, as such you cannot. There would be security and other issues.


您所说的控制"到底是什么意思?如果这两个应用程序都是您的,则可以在它们之间发送消息以进行通信并采取适当的措施.但是我认为这样做没有任何好处.实际上,事实恰恰相反.

如果应用程序不是您的应用程序,则可以检测并发送Windows消息,但这完全是另一回事.

因此,总而言之,最好不要.
What exactly do you mean by "control"? If both applications are yours, then you can send messages between them to communicate and take action appropriately. But I don''t see any advantage on doing it. In fact it is will be the opposite.

If the applications are not yours, You can instrument and send windows messages, but that is completely different story.

So, in short, better Not.


是的,但是它会令人讨厌.
Windows系统中的每个控件都有一个句柄.您需要找到要访问的控件的句柄.
有了句柄后,就可以使用 SendMessage [
Yes you can but it can get nasty.
Every control in a windows system has a handle. You need to find the handle for the control you want access to.
Once you have the handle you can use SendMessage[^] to send whatever you need.


这篇关于使用C#控制另一个应用程序中的另一种形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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