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 Discussion / How do you find the size of the desktop?

Author
Message
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 17th Apr 2009 14:22
I've got a small project on at the moment which runs in a windowed mode ("Set Window On") but I want to make it fill the screen automatically and run in the same display resolution as the users desktop.

I've tried using Screen Width() and Bitmap Width(0), but they only return the width of the DBC window and not the width of the screen, so is there a dll call that can return this data?

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 17th Apr 2009 14:58 Edited at: 17th Apr 2009 15:05


As an exe, DB seems to run at the same speed as it does in the editor - which means it's faster as an exe in windowed mode than full screen mode. But keeping the window maximized can be a task...

Enjoy your day.
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 17th Apr 2009 18:16
hahaha more api calls latch! lol. he will have a hole library of his own by the time your done with him!

nice one though.

New Site! Check it out \/
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 19th Apr 2009 22:03
Yes, very nice! Thank you!

Quote: "But keeping the window maximized can be a task..."

Not really - I just call:

(I'm typing from memory, might have one or two of the commands named wrong, but you get the idea). With no handles on the window, it can't be resized or repositioned, but it can be successfully minimised and restored!

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Apr 2009 00:04
Ah, there's no title bar - there's the key! I was trying to remember why I put a title bar on my db/windows app - (I just took a peek at the code as I'm writing this) I wanted to use a windows menu and without the title bar, the menu appeared at the very top, and I wasn't able to make my own title bar with that happening.

Another note, if you use those system metrics commands, be aware that your app will inherit the size and depth of the desktop it is run on so that could be resolution and depth > or < than your computer. That means there could be some speed differences and the positioning of your tools in 2d would have to be sized relatively. Text too. But you're probably already aware of that.

Enjoy your day.

Login to post a reply

Server time is: 2024-05-20 10:55:02
Your offset time is: 2024-05-20 10:55:02