SouLDragooN

I am sure this is easy, but I am new to C# and having a hard time re-focusing the XNA window to the front after my splash screen is done.... when the splash screen goes I need someway to call something similar to this.focus....Help please =)..

Thanks.....



Re: XNA Framework Re-focusing XNA game window

dczraptor

Couldn't you just display your splash screen _inside_ of your XNA app




Re: XNA Framework Re-focusing XNA game window

Kyle_W

This issue speaks to the general lack of APIs for manipulating the game window as discussed on this thread:

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1278510&SiteID=1

Hopefully there will be improvement in this area in the next release of XNA. In the meantime, the following will probably work for you:

using System.Windows.Forms;

...

Form myForm = (Form)Form.FromHandle(this.Window.Handle);
myForm.Activate();





Re: XNA Framework Re-focusing XNA game window

SouLDragooN

 dczraptor wrote:
Couldn't you just display your splash screen _inside_ of your XNA app


That could be a solution, however I want it up as soon as possible. Displaying a MOTD and an image to let the user know it is loading... before all the initializations that occur.. those can take many seconds...

 Kyle_W wrote:

This issue speaks to the general lack of APIs for manipulating the game window as discussed on this thread:

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1278510&SiteID=1

Hopefully there will be improvement in this area in the next release of XNA. In the meantime, the following will probably work for you:

using System.Windows.Forms;

...

Form myForm = (Form)Form.FromHandle(this.Window.Handle);
myForm.Activate();




Thank you very much for the response I will give that a go... I was expecting them to have something to the effect of

Game.Window.Focus();

but of course that was not there.





Re: XNA Framework Re-focusing XNA game window

SouLDragooN


using System.Windows.Forms;

...

Form myForm = (Form)Form.FromHandle(this.Window.Handle);
myForm.Activate();

worked like a champ thank you very much. You saved me a lot of digging.





Re: XNA Framework Re-focusing XNA game window

Shawn Hargreaves - MSFT

dczraptor wrote:
Couldn't you just display your splash screen _inside_ of your XNA app


That's how I would do this. When the app starts up, load the splash screen graphic, display it, then do the slower load of all the rest of your content while the splash screen is up to cover it.





Re: XNA Framework Re-focusing XNA game window

Bill Reiss

If you want to run it on the Xbox, you'll have to have the splash screen inside the app window anyway, unless you don't plan on running it there.




Re: XNA Framework Re-focusing XNA game window

Jim Perry

Shawn Hargreaves - MSFT wrote:
dczraptor wrote:
Couldn't you just display your splash screen _inside_ of your XNA app


That's how I would do this. When the app starts up, load the splash screen graphic, display it, then do the slower load of all the rest of your content while the splash screen is up to cover it.

QFT and clicky






Re: XNA Framework Re-focusing XNA game window

SouLDragooN

I am targeting PC since sadly there is no current method of commerce on the XBOX ( I cannot sell hundreds of hours for pocket lint =) ). I want to have something up at the moment they double click the icon to let them know it is running along with the login process based in windows UI (login and pass). Then while all that mess is going on I am loading the major load items I need to load. Just getting the device started and XNA window up I have seen 3-10 seconds... on my oldest compatible PC.. so a splash screen while I load the scenes is the method I have chosen...

Thanks for the answers they worked wonders.....

and I love XNA! =) and these forums... wish all this was here when I started in the game industry.....








Re: XNA Framework Re-focusing XNA game window

Kyle_W

If my answer worked for you, don't forget to mark it as an answer so I'll get credit for it.