Ccurrent display settings

Blitz3D Forums/Blitz3D Beginners Area/Ccurrent display settings

Osoko(Posted 2005) [#1]
Hi

I just want to have my game launched in full screen with the current display setting of my monitor.

How to know the current resolution of the screen ?

Thanks


nrasool(Posted 2005) [#2]
Hi there,

The way i did this, was to use following user32.dll decls:
http://www.blitzbasic.com/codearcs/codearcs.php?code=1179

copy and paste this into notepad and put it in to my 'C:\Program Files\Blitz3D\userlibs'. Save this as 'User32.decls'.

Then in my code right at the start i put the following

Const title$ = "blitzapp"

Const SM_CXSCREEN		= 0
Const SM_CYSCREEN		= 1

window_w = api_GetSystemMetrics(SM_CXSCREEN); 640
window_h = api_GetSystemMetrics(SM_CYSCREEN); 480
Graphics3D window_w, window_h, 0, 1

AppTitle title$

blitz_hnd = api_FindWindow("Blitz Runtime Class", title$) ; Find this window

api_SetWindowLong(blitz_hnd, GWL_STYLE, WS_VISIBLE)	; Set the windows style flags

api_MoveWindow(blitz_hnd, (api_GetSystemMetrics(SM_CXSCREEN) - window_w) Shr 1, (api_GetSystemMetrics(SM_CYSCREEN) - window_h) Shr 1, window_w, window_h, 1)


Work fine on my basic small demo,
http://nrasool.nadcom.co.uk/?Tech_Demos:Hellraiser_Lament_Box_Configuration


jfk EO-11110(Posted 2005) [#3]
BTW you don't need to use the FindWindow function to get the HWND of your app (this also doesn't allow multiple apps with the same apptitle), instead use

blitz_hnd%=Systemproperty$("AppHWND")


Osoko(Posted 2005) [#4]
Thanks a lot !

It works fine and takes me 5 min of implementation.
I really thanks the community, and you nrasool.

This code is very usefull for public apps, because i think a lot of people doesn't knew what 1024*768 is supposed to means !