Windows XP - 监控进程和如果进程崩溃则重新启动
这是我的第一个 Windows 问题,如果这是显而易见的或措辞错误的,我深表歉意。
我有一个在 Kisok 模式下运行 Opera 的触摸屏站 (http://www.opera.com/ support/mastering/kiosk/)这很棒并且工作完美。
我希望能够监视 Opera 进程并在它崩溃或关闭时重新启动它。
任何人都可以给我一些关于如何完成此操作的指导,或者是否有任何开箱即用的软件可以为我完成此操作?
This is my first windows question so apologies if this is obvious or badly worded.
I have a touch screen station that runs Opera in Kisokmode (http://www.opera.com/support/mastering/kiosk/) which is great and works perfectly.
I want to be able to monitor the Opera process and relaunch it if it crashes or is closed.
Can anyone give me some direction on how this can be done, or is there any out-of-the-box software that can do this for me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一些软件可以监视进程并在进程被杀死时重新启动它们:
http://www.knas.se/Applications/Restarter.aspx
http://drinkprog.com/kiwi/
实现此类软件的方法之一是:
1. 使用具有
SYNCHRONIZE
访问权限的OpenProcess
API 打开需要监控的目标进程的句柄。2. 使用
WaitForSingleObject
或WaitForMultipleObjects
API 无限等待该句柄。3. 如果进程退出或被终止,则将发出等待信号(返回码 WAIT_ABANDONED 或 WAIT_OBJECT_0)。
4. 关闭手柄。重新启动进程并重复上述步骤。
There are some software to monitor processes and restart them if they are killed:
http://www.knas.se/Applications/Restarter.aspx
http://drinkprog.com/kiwi/
Just one of the ways to implement such software would be:
1. Open a handle of the target process that needs to be monitored, using
OpenProcess
API withSYNCHRONIZE
access right.2. Wait infinitely on that handle using
WaitForSingleObject
orWaitForMultipleObjects
APIs.3. If the process exits or gets killed, then wait would be signaled (with return code WAIT_ABANDONED or WAIT_OBJECT_0).
4. Close the handle. Restart process and repeat the above steps.