Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows XP - monitor process & relaunch process if it crashes

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?

like image 317
Jake N Avatar asked Dec 18 '25 01:12

Jake N


1 Answers

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.

like image 187
swatkat Avatar answered Dec 19 '25 23:12

swatkat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!