ZFGC
Resources => Coding => Topic started by: sjegtp on February 26, 2009, 05:46:52 pm
-
How can I set the starting position of the window of the program?
I'm using C++ with SDL.
-
There's a parameter for it in the CreateWindowEx() function. Parameter 5 is the x position, and 6 is the y position.
-
Hmm... the problem is that SDL creates the window automatically for you, so if I call this function I'll end up creating another window.
Is there a way to modify the x and y values after the window was created?
EDIT: Never mind, I *finally* found it at google.
SDL_SysWMinfo i;
SDL_VERSION( &i.version );
if ( SDL_GetWMInfo ( &i) ) {
HWND hwnd = i.window;
SetWindowPos( hwnd, HWND_TOP, x, y, width, height, flags );
}
-
http://sdl.beuc.net/sdl.wiki/SDL_envvars
needs to be set before you init the window.
-
Thanks Windy.
I just tried that now, but the previous code worked better.
Anyway, problem solved.