# SDL window on middle of the screen

This topic is 4668 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, Is it possible to let the window you get from SDL_SetVideoMode() start at the middle of the screen instead of just at some random place? I mean want to have a small window, with no frames in the middle of the screen. But it will just go to the top right corner of the left bottom of the screen etc. I hope someone knows a solution. Greetings, Rob

##### Share on other sites
if you want a multiplatform solution, you can't. If you want a windows-only solution then you can have a look at SDL_GetWMInfo function.

#include <SDL/SDL_syswm.h> // you must include this, as it's not                           // included in SDL.hint main(int argc,char *argv[]){  SDL_SysWMInfo wminfo;  HWND hwnd;//SDL initialization, main window creation, etc//...  SDL_VERSION(&wminfo.version);  SDL_GetWMInfo(&wminfo);  hwnd=wminfo.window;//do whatever you want with the window  }

with the HWND of the main window, you can use Win32 API functions to do whatever you want with the window.

PS: This question has been asked before, you can found the post here

##### Share on other sites
Nah I was searching for a multiplatform solution.
In that case I'll just make it full-screen.

Greetings,
Rob