Window position in windowed mode

Blitz3D Forums/Blitz3D Programming/Window position in windowed mode

Pinete(Posted 2007) [#1]
Hi,
I would like to know how to define the position in where the blitz window appears when it's executed in windowed mode.
There exist some way to do this?
Could you please point me in the right direction?

regards!


jfk EO-11110(Posted 2007) [#2]
Using a decls declared Api call, something with "SystemMetrics" maybe. Or the user32.dll functions. I would suggest to download the ol win32.hlp (or similar) file that is a reference for all dlls and their functions that are part of the win api. This is going to make it easy to declare functions in the *.decls files.


Quantum(Posted 2007) [#3]
Would that also apply for the "start.bb" window size jfk?... I've been playing with increasing the size of that to include an option screen.

Sorry to hijack your question Pinete.


JoeGr(Posted 2007) [#4]
1) Copy this to your userlibs folder:

http://www.blitzbasic.com/codearcs/codearcs.php?code=1179

2) Use the following code anywhere after 'Graphics' or 'Graphics3D' to set the window's position and size (replacing x, y, w, and h with your own values). Don't exceed the window size that you set with the Graphics command though or it will probably mess up.
hWnd=SystemProperty("apphWnd")
api_SetWindowPos hWnd,0,x,y,w,h,0

EDIT: This won't affect the small startup window but there's a hack which allows you to get rid of that completely. Then you can change the size of the main window as and when you please.