Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am working on an application where i need to monitor a selected program and if it is crashed or not working i need to start.I am searching for the code from 2 days but I am able to find functionality samples but couldnt find the code

The functioality is just like how it works in this link http://www.mydigitallife.info/2008/10/10/tips-of-how-to-restart-crashed-applications-automatically-in-windows-pc/

Can anyone pls provide me the code for monitoring and restarting a selected program
Posted
Updated 23-Aug-10 8:26am
v2

You have to use the SendMessageTimeout API function and send the application being mounitored the WM_NULL message, along with the timeout (from 0 to 15 seconds, expressed in milliseconds).

Go here to learn how to use this function in a C# application:

http://www.pinvoke.net/default.aspx/user32.SendMessageTimeout[^]
 
Share this answer
 
oh my god ,this things can't to do in .net Framework,you must call ths WIN32 API
this is a nightmare in C# ,you should use DELPHI OR VC++ to do this
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900