[SDL] minimized full screen

Simon simon.xhz at gmail.com
Tue Feb 6 10:19:56 PST 2007


> 1) can I know if my SDL window is minimized?

The window manager will tell your application when it loose or gain 
focus, you can trap it as an event.

Take a look at this here:
http://www.libsdl.org/docs/html/eventstructures.html
And more specifically:
http://www.libsdl.org/docs/html/sdlsyswmevent.html

> 2) is there a command to re-maximize it?

As for this, well, I think it can be in your power, but is it something 
you want to give to your users?  If I personally decide to minimize the 
application (without clicking a button in your application) will the 
application refocus itself (disobeying my request to minimize it)?

I would not touch that, but rather stop the execution of the program if 
it doesn't have focus.

Also, if the DOS window that pops up is done by your program, then you 
might consider an alternative that does not use a dos window, while if 
any other window pops up you might want to let the user decide which is 
most important (your prog or the other one).

As for the trick to refocus the window, I'm not sure if SDL has done 
anything for it, but you might need to do an API call (include 
<windows.h>) and loose a bit of compatibility with other OSes.  But I 
don't know the name of the function, try googling these keywords: "force 
focus window api" (and unfortunately the solution might: not work for 
all windowses and some might require .net, etc, etc...)

Personally, I leave all that to the user and wash my hands! ;)

Simon


More information about the SDL mailing list