static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // idle start Application.Idle += new EventHandler(Application_Idle); loadFrm = new MkaFrmLoading(); loadFrm.Show(); Application.DoEvents(); // register file type Register(); // Check command line if (args.Length > 1) { MessageBox.Show("Incorrect number of arguments. Usage: MokkAnnotator.exe [filenames]", "MokkAnnotator"); } MkaFrmAnnotator form = new MkaFrmAnnotator(); if (args.Length == 1) { form.ArgumentFile = args[0]; } Application.Run(form); // idle end Application.Idle -= new EventHandler(Application_Idle); }
static void Application_Idle(object sender, EventArgs e) { if (loadFrm != null) { loadFrm.Close(); loadFrm.Dispose(); loadFrm = null; } }