Windows XP - 监控进程和如果进程崩溃则重新启动

发布于 2024-10-01 08:15:33 字数 316 浏览 0 评论 0原文

这是我的第一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绿光 2024-10-08 08:15:33

有一些软件可以监视进程并在进程被杀死时重新启动它们:
http://www.knas.se/Applications/Restarter.aspx
http://drinkprog.com/kiwi/

实现此类软件的方法之一是:
1. 使用具有 SYNCHRONIZE 访问权限的 OpenProcess API 打开需要监控的目标进程的句柄。
2. 使用 WaitForSingleObjectWaitForMultipleObjects 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 with SYNCHRONIZE access right.
2. Wait infinitely on that handle using WaitForSingleObject or WaitForMultipleObjects 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文