views:

125

answers:

1

I have implemented a Splash Screen according to WiredPrairie unmanaged c++ splasher class.

But not when my application loads, my window isn't activated. The user has to click on the login box even thought it is the only window open in my application.

I have tried the following but none of these work.

            Topmost = true;
            Focus();
            Activate();

Is there any way to give my login window focus when the application starts? Sometimes the window behind it has focus! (Visual Studio if run on my machine), Explorer or a different application window on other peoples machines.

Anyone have any idea?

+1  A: 

Where did you try Activate()?

I found that using it in the window's constructor did not help, but calling it when the Load event occured did activate it.

I have had this problem in a different scenario, though...

Jens
If this works, I think I'm going to quit programming....
LnDCobra
Lol thanks for that! I wish that was documented somewhere. I always assume that once InitializeComponent(); is complete that is the window loaded... Guess I am VERY wrong! Once again appreciate the help!
LnDCobra
Good luck in finding a new job then... ;-)
gehho