How can I make a program that will activate a code when a program/process stated was opened without starting the stated program itself.
Right now I have this code:
while (!IsProcessOpen("ThisProcess")) //"IsProcessOpen" just checks whether the program stated is open in the task manager.
{
}
gopatch.DoWork += new DoWorkEventHandler(gopatch_DoWork);
gopatch.RunWorkerCompleted += new RunWorkerCompletedEventHandler(gopatch_RunWorkerCompleted);
gopatch.RunWorkerAsync();
but this way uses way too much cpu. Is there a way to make it use less cpu but get the job done as I wanted it to?