Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            bool createdNew, success = false;

            g_Mutex = new System.Threading.Mutex(true, "XRmonitorsUIUnique", out createdNew);
            if (g_Mutex != null)
            {
                success = true;
            }

            if (!success || !createdNew)
            {
                MessageBox.Show("Another instance of XRmonitorsUI.exe is already running.  \n\nClose the other instance of the program before running.", "XRmonitors - Already Running");
                return;
            }

            StartLoggingToFile("XRmonitorsUI");

            XRmonitorsGuid = new Guid("1513D568-C504-4B24-A49D-2F532AEEB824");
            InstallPath    = ReadInstallPath();

            StartMemoryMappedFile();

            // Create these after setup so that the dependencies above are available
            g_OpenXrNeeded = new XRmonitorsUI.OpenXrNeeded();

            g_MainForm = new XRmonitorsUI.MainForm();
            Application.Run(Program.g_MainForm);
        }
Ejemplo n.º 2
0
        //----------------------------------------------------------------------
        // Entrypoint
        //----------------------------------------------------------------------

        static public void ShowMainForm()
        {
            if (g_MainForm == null)
            {
                g_MainForm = new XRmonitorsUI.MainForm();
            }
            Program.g_MainForm.Show();
        }