Splash screen does not return focus to main form.
I everyone. I currently have a problem with my focus when using a splash screen. I am using VS2008, with .NET framework 2.0. Also, I have linked my project with the VisualBasic.dll since I use the ApplicationServices to manage my single instance app and splash screen.

Here is a code snippet simplified of what I tried debugging.

    namespace MyProject
    {
    	public class Bootstrap
    	{
    		/// <summary>
    		/// Main entry point of the application. It creates a default 
    		/// Configuration bean and then creates and show the MDI
    		/// Container.
    		/// </summary>
	    	[STAThread]
	    	static void Main(string[] args)
	    	{
	    		// Creates a new App that manages the Single Instance background work
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
    			App myApp = new App();
	    		myApp.Run(args);
	    	}
    	}

        public class App : WindowsFormsApplicationBase
        {
            public App()
                : base()
            {
                this.IsSingleInstance = true;
            }

            protected override void OnCreateSplashScreen()
            {
                this.SplashScreen = new Form();
                this.SplashScreen.StartPosition = FormStartPosition.CenterScreen;
            }
            protected override void OnCreateMainForm()
            {
                // Do your initialization here
                //...
                System.Threading.Thread.Sleep(5000);  // Test
                // Then create the main form, the splash screen will automatically close
                this.MainForm = new Form1();
            }
        }
    }

Now, what happens is that, when I start the application, the Splash Screen shows as expected, but when it is destroyed, it does not return the focus to the main form (Form1 in the test). The MainForm simply flashes orange in the taskbar. If I launch the application from the IDE (VS2008), focus works just fine. I am using XP Pro. Also, the main form is not on top of every other windows. If I comment out the OnCreateSplashScreen() method, the application gets focus normally.

To test normal execution, I am using the VS Command Prompt to launch my application. I am using the Release version of my project.

Any ideas?
Splash screen does not return focus to main form.
===

I everyone. I currently have a problem with my focus when using a splash screen. I am using VS2008, with .NET framework 2.0. Also, I have linked my project with the VisualBasic.dll since I use the ApplicationServices to manage my single instance app and splash screen.

Here is a code snippet simplified of what I tried debugging.

    namespace MyProject
    {
    	public class Bootstrap
    	{
    		/// <summary>
    		/// Main entry point of the application. It creates a default 
    		/// Configuration bean and then creates and show the MDI
    		/// Container.
    		/// </summary>
	    	[STAThread]
	    	static void Main(string[] args)
	    	{
	    		// Creates a new App that manages the Single Instance background work
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
    			App myApp = new App();
	    		myApp.Run(args);
	    	}
    	}

        public class App : WindowsFormsApplicationBase
        {
            public App()
                : base()
            {
                this.IsSingleInstance = true;
            }

            protected override void OnCreateSplashScreen()
            {
                this.SplashScreen = new Form();
                this.SplashScreen.StartPosition = FormStartPosition.CenterScreen;
            }
            protected override void OnCreateMainForm()
            {
                // Do your initialization here
                //...
                System.Threading.Thread.Sleep(5000);  // Test
                // Then create the main form, the splash screen will automatically close
                this.MainForm = new Form1();
            }
        }
    }

Now, what happens is that, when I start the application, the Splash Screen shows as expected, but when it is destroyed, it does not return the focus to the main form (Form1 in the test). The MainForm simply flashes orange in the taskbar. If I launch the application from the IDE (VS2008), focus works just fine. I am using XP Pro. Also, the main form is not on top of every other windows. If I comment out the OnCreateSplashScreen() method, the application gets focus normally.

To test normal execution, I am using the VS Command Prompt to launch my application. I am using the Release version of my project.

Any ideas?