[英]How can i make my exe to be bounded to some other exe?
How can i make my exe to be bounded to some other exe? 如何使我的exe绑定到其他exe? I mean that, For Ex- my application is - A. and one another application is also running independently B. Now how can i make my application to be closed when application B is closed?
我的意思是,对于Ex-我的应用程序是-A。另一个应用程序也正在独立运行B。现在,当应用程序B关闭时,如何使我的应用程序关闭?
If you can modify application B, use the Process
class, and its CloseMainWindow
method. 如果可以修改应用程序B,请使用
Process
类及其CloseMainWindow
方法。 See the MSDN documentation . 请参阅MSDN文档 。
If you cannot modify application B, you'll have to poll for it in application A. Again, use the Process class. 如果无法修改应用程序B,则必须在应用程序A中对其进行轮询。再次使用Process类。
Keep a running method in your Main, that searches for application B's process. 在Main中保留一个正在运行的方法,该方法搜索应用程序B的进程。 And if not found
Application.exit()
Thats keeping it simple... 如果没有找到
Application.exit()
那就保持简单...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.