static void Main() { if (mutex.WaitOne(TimeSpan.Zero, true)) { // Init the last.fm authentication with the user set username and password Task lastFMInit = new LastFM().init(); lastFMInit.Wait(); Cef.EnableHighDPISupport(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new CoreMusicApp()); mutex.ReleaseMutex(); } else { // send our Win32 message to make the currently running instance // jump on top of all the other windows NativeMethods.PostMessage( (IntPtr)NativeMethods.HWND_BROADCAST, NativeMethods.WM_SHOWME, IntPtr.Zero, IntPtr.Zero); } }