using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace Trial
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new AppContext());
        }
    }
    public class AppContext : ApplicationContext
    {
        public AppContext()
        {
            Application.Idle += new EventHandler(Application_Idle);
            frmSplashScreen fSplashScreen = new frmSplashScreen();
            fSplashScreen.Show();
        }
        void Application_Idle(object sender, EventArgs e)
        {
            if (Application.OpenForms.Count == 0)
                Application.Exit();
        }
    }
}
