System.Diagnostics.Process[] processes =
System.Diagnostics.Process.GetProcesses();
processParent
{
System.Diagnostics.Process[] processNames =
System.Diagnostics.Process.
GetProcessesByName
(processParent.ProcessName);
processChild
System.IntPtr hWnd =
processChild.MainWindowHandle;
ShowWindowAsync(hWnd, SW_RESTORE);
}
SetForegroundWindow(hWnd);
MainWindowTitle.Equals(
processChild.CloseMainWindow();
processChild.Kill();
processChild.WaitForExit();
}Full code can be found: http://www.codeproject.com/csharp/timercomputershutdown.asp I am only using this part of the code to shut down, however, i am only restarting the computer, not powering down for good.Can anyone shed some light onto this?Thanks