Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Screen height/width issue with window state

Author
Message
Zdaxxy
17
Years of Service
User Offline
Joined: 9th Sep 2002
Location:
Posted: 15th Sep 2002 06:49
I was creating a window, kinda like a spash but I wanted to center it no mater what display rez the user was using...

here is the code..


But for some reason, no matter what resolution im
running in, it always returns 640x480...

Is there something wrong im doing?
Capricorn
17
Years of Service
User Offline
Joined: 30th Aug 2002
Location: - Please Select -
Posted: 15th Sep 2002 10:24
Try using - set display mode - to set the screen size.

set display mode 800,600,16

So this will set the screen to 800*600 with a color depth of 16.

Capricorn
17
Years of Service
User Offline
Joined: 30th Aug 2002
Location: - Please Select -
Posted: 15th Sep 2002 12:27
Oh, I see. You want to detect the users screen res and set your programme to run at the same resolution. I don’t know how to do this, sorry.

screen height() and screen width() return the resolution your programme is running in. and unless you tell it otherwise it will be set to 640*480

Zdaxxy
17
Years of Service
User Offline
Joined: 9th Sep 2002
Location:
Posted: 15th Sep 2002 21:31
Exactly, since you can do WINDOW mode, it would realy be helpful to find out if their DESKTOP is 800x600, 1024x768 etc, so when you launch the window, you can center it to match their desktop.

Was hoping DB had a command that could pull that information..

If not, gona have to use that external DLL feature =(

Zdaxxy
17
Years of Service
User Offline
Joined: 9th Sep 2002
Location:
Posted: 17th Sep 2002 01:54
Lack of replies leads me to belive this IS NOT possible in the current version of DB without external help??

MrTAToad
17
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 17th Sep 2002 12:55
I think your right there. Its a mere trifle to write something to get the screen width, height etc.

The hardest part is getting all the values back

Yes, I really am THAT good...
Arminus
17
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Australia
Posted: 17th Sep 2002 13:52
You'd Prob have to write a DLL in C to do that (Unless you can work out how some of the windows DLL's work that give u that info)

Incontinance, the lazy mans excuse!
MrTAToad
17
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 17th Sep 2002 14:20
Yes, I forgot to mention that its easy in C - the hardest part is getting the data back. Mr INT64 will probably have to make an appearance as addresses of cant be passed..

Yes, I really am THAT good...
Zdaxxy
17
Years of Service
User Offline
Joined: 9th Sep 2002
Location:
Posted: 18th Sep 2002 00:36
I have the DLL now, I can't belive I had to do this via external process..

x=call dll (1,dbScreenHeight)
y=call dll (1,dbScreenWidth)

Which works just fine....

If any of you guys need the dll file just let me know.

Login to post a reply

Server time is: 2019-11-13 20:32:25
Your offset time is: 2019-11-13 20:32:25