Пример #1
0
        static void Main(string[] args)
        {
            Process p = PriorProcess();

            if (p != null)
            {
                DialogResult result = MessageBox.Show("Another instance of the app is already running. \nStart a new instance and continue running?",
                                                      "dGPU idle",
                                                      MessageBoxButtons.YesNoCancel);
                if (result != DialogResult.Yes)
                {
                    if (result == DialogResult.No)
                    {
                        p.Kill();
                    }
                    return;
                }
                p.Kill();
                Application.DoEvents();
                Thread.Sleep(50);
            }
            using (D3DApp app = new InitDirect3DApp(Process.GetCurrentProcess().Handle))
            {
                app.InitializeNoFPS(); //JO: don't show FPS
                //IntPtr hWind = app.GetWindowHandle();
                //ShowWindow(hWind, WindowShowStyle.Hide);
                app.WHide();
                app.Run();
            }
        }
Пример #2
0
 static void Main(string[] args)
 {
     using (D3DApp app = new InitDirect3DApp(Process.GetCurrentProcess().Handle))
     {
         app.Initialize();
         app.Run();
     }
 }