From 7e61f52dd18d7cdf072b5d4352ba23e0dffcca06 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Tue, 9 May 2017 16:34:56 -0700 Subject: [PATCH] Launch new task for Launch Program with Profile --- DS4Windows/DS4Control/ScpUtil.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/DS4Windows/DS4Control/ScpUtil.cs b/DS4Windows/DS4Control/ScpUtil.cs index fdebd0b..89b8642 100644 --- a/DS4Windows/DS4Control/ScpUtil.cs +++ b/DS4Windows/DS4Control/ScpUtil.cs @@ -7,6 +7,7 @@ using System.Xml; using System.Drawing; using System.Security.Principal; +using System.Threading.Tasks; namespace DS4Windows { @@ -2004,12 +2005,17 @@ namespace DS4Windows if (!procFound) { - System.Diagnostics.Process tempProcess = new System.Diagnostics.Process(); - tempProcess.StartInfo.FileName = programPath; - tempProcess.StartInfo.WorkingDirectory = new FileInfo(programPath).Directory.ToString(); - //tempProcess.StartInfo.UseShellExecute = false; - try { tempProcess.Start(); } - catch { } + Task processTask = new Task(() => + { + System.Diagnostics.Process tempProcess = new System.Diagnostics.Process(); + tempProcess.StartInfo.FileName = programPath; + tempProcess.StartInfo.WorkingDirectory = new FileInfo(programPath).Directory.ToString(); + //tempProcess.StartInfo.UseShellExecute = false; + try { tempProcess.Start(); } + catch { } + }); + + processTask.Start(); } }