Desktop Size?

BlitzMax Forums/MaxGUI Module/Desktop Size?

LeeFbx(Posted 2008) [#1]
<code>
Local window:TGadget
Local DTop:TGadget = Desktop:TGadget()

Local dtw:Int = GadgetWidth(DTop)
Local dth:Int = GadgetHeight(DTop)

Print dtw+" , "+dth
<end code>

This code returns 2080 for the width of my desktop.

I am using a screen resolution of 1280x1024. Maximum for my monitor is 1920.
Why does GadgetWidth return such a high value?


jsp(Posted 2008) [#2]
It depends on your screen configuration (second screen attached, virtual soft screen...)
Use ClientWidth(Desktop()) and ClientHeight(Desktop()) to get only the primary screen parameter, that should solve it.


plash(Posted 2008) [#3]
http://www.chaos-interactive.de/index.php?show=12&lang=eng
Crossplatform.


SebHoll(Posted 2008) [#4]
Use ClientWidth(Desktop()) and ClientHeight(Desktop()) to get only the primary screen parameter

Arrgghhh! When I was implementing the new WINDOW_CENTER flag in MaxGUI, I couldn't remember whether it was ClientWidth() or GadgetWidth() that returns the primary monitor resolution. Anyway, if it is the former, then I opted for the wrong one - oh well, I'll remember to fix it in the next release for those fortunate people with a decent dual monitor set-up ;-).


LeeFbx(Posted 2008) [#5]
OK. Thanks to all.
I don't really have dual monitors but I do use UltraMon
to mirror my monitor to my TV, which creates a number of odd quirks.