public Task StartAsync(Tool tool) { IntPtr desktopHandle = WindowsUtility.CreateDesktop(DesktopName); // embrace the madness -- it seems Windows always wants exactly one instance of "ctfmon.exe" in the new desktop var ctfmonStartInfo = new ProcessStartInfo { FileName = "ctfmon.exe", WorkingDirectory = "." }; WindowsApi.PROCESS_INFORMATION ctfmonProcess = WindowsUtility.CreateProcess(ctfmonStartInfo, DesktopName); AssociateWithJob(ctfmonProcess, false); // start the desired process var arguments = string.Join(" ", tool.Settings.GetArguments(tool)); var startInfo = new ProcessStartInfo { FileName = tool.ExecutablePath, Arguments = arguments, WorkingDirectory = tool.WorkingDirectory }; WindowsApi.PROCESS_INFORMATION targetProcess = WindowsUtility.CreateProcess(startInfo, DesktopName); AssociateWithJob(targetProcess, true); WindowsApi.CloseDesktop(desktopHandle); return(Task.FromResult((object)null)); }