Click here to Skip to main content
16,005,826 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have created a windows forms application(Restarter) which is used to check if a program is running and if it is not running it should restart the program. At present if i select a program and click on restart button the program wil be restarted, Now what i want is as soon as my restarter applicatio starts,it should check all the programs in the list and start them if they are stopped. all the progams to be started will be in xml file. Can anyone pls help me out with sample code or any suggestions.
Posted

1 solution

Process.Handle is a handle to a process that can be used as a parameter to many process-information and control functions. You can use this handle to initialize a WaitHandle.

WaitHandle has a static method:
C#
public static int WaitAny(
    WaitHandle[] waitHandles
)


See WaitAny[^] for more info on that method.

The WaitHandle will be signalled when a process terminates/exits.

Regards
Espen Harlinn
 
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