关于窗口应用程序中的Onexit事件 [英] regarding Onexit event in window application

查看:122
本文介绍了关于窗口应用程序中的Onexit事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,

我在Window应用程序中遇到问题.我的问题是..

我从我的代码中调用java .exe意味着从我的代码中启动Java服务器

如果有人从进程探索中杀死我的应用程序.exe,我想关闭java.exe

所以那个时候我打哪个电话?
如何确定我的exe被杀死?

请提出建议或回复

谢谢

问候,
purav shah

Hello Friend,

I have problem in Window application.My Problem is..

i called java .exe from my code means start java server from my code

if any body kill my application .exe from process explore at that i want to close java.exe

so at that time which event i call?
how can i identify my exe is kill?

please give suggestion or reply

thanks

regards,
purav shah

推荐答案

下面是CodeProject文章,介绍了该技术: ^ ]
很可能您需要一个可以与C#程序集接口的C ++项目.

我认为有更好的解决方案.

该解决方案基于WMI,并带有以下C#代码: http://weblogs.asp. net/whaggard/archive/2006/02/11/438006.aspx [ ^ ].
简而言之,您应该使用类System.Management.ManagementEventWatcher来完成操作.

—SA
Here is the CodeProject article explaining the technique: Hooking the native API and controlling process creation on a system-wide basis[^]
Most probably you need a C++ project which can interface with your C# assembly.

I think, there is a better solution.

This solution is based on WMI and complete with C# code: http://weblogs.asp.net/whaggard/archive/2006/02/11/438006.aspx[^].
In a nutshell, you should use the class System.Management.ManagementEventWatcher to do the trick.

—SA


这篇关于关于窗口应用程序中的Onexit事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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