I am trying to design a windows-service which monitors a process namely "Gtalk", if the process is started then, the browser Internet-explorer (process iexplore) should be closed. This should happen only when the process "Gtalk" is started, [not when running]
The code I have written and implemented, doesn't allow to open IExplore when Gtalk is running. That is certainly what not I am trying for. The process Gtalk should close browser only at its start-up, After the process is started, it should allow to open IExplore.
Is it possible with Windows service or is it must be the part of Gtalk process itself?
This is my code:
while (true)
{
if (Process.GetProcessesByName("Gtalk").Length > 0)
{
foreach (Process prc in Process.GetProcessesByName("IExplore"))
{
prc.Kill();
}
}
}