diff --git a/DS4Windows/Program.cs b/DS4Windows/Program.cs index 41c370e..0f81bea 100644 --- a/DS4Windows/Program.cs +++ b/DS4Windows/Program.cs @@ -102,7 +102,8 @@ namespace DS4Windows //if (mutex.WaitOne(TimeSpan.Zero, true)) //{ - rootHub = new ControlService(); + createControlService(); + //rootHub = new ControlService(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new DS4Form(args)); @@ -116,6 +117,16 @@ namespace DS4Windows threadComEvent.Close(); } + private static void createControlService() + { + Thread temp = new Thread(() => { rootHub = new ControlService(); }); + temp.Priority = ThreadPriority.Normal; + temp.IsBackground = true; + temp.Start(); + while (temp.IsAlive) + Thread.SpinWait(500); + } + private static void CreateTempWorkerThread() { testThread = new Thread(singleAppComThread_DoWork);