示例#1
0
        /// <summary>
        /// Check whether the GUI process has already been started.
        /// </summary>
        public static bool CheckSingleton(string processName, IntPtr windowHandle)
        {
            if (IsDuplicateInstance(processName) && !Settings.Default.IsRestarting)
            {
                windowHandle.ActivateWindow();

                Exit();
                return(false);
            }

            Settings.Default.IsRestarting = false;
            return(true);
        }