Win32 desktop resolution?

BlitzMax Forums/MaxGUI Module/Win32 desktop resolution?

Vilu(Posted 2007) [#1]
Is there any way to get the current screen resolution when using MaxGUI? GraphicsHeight() and GraphicsWidth() only seem to work when the graphics mode is initialized by BlitzMax.

I need a way to auto-center a window based on the current height and width of the screen.

If there's no "Max-way" of doing this, there could be a built-in dll call in Windows for this. All suggestions appreciated!


tonyg(Posted 2007) [#2]
mygadget:TGadget = Desktop()
Print GadgetWidth(mygadget)

?


Vilu(Posted 2007) [#3]
Ah, thank you. Didn't know about the Desktop() function.

Another issue was brought up, though: I have an extended desktop spanning two monitors and the Desktop() function returns the combined width, while I would prefer only the main monitor width. Any solutions here? ;)


jsp(Posted 2007) [#4]
Use ClientWidth instead of GadgetWidth


Vilu(Posted 2007) [#5]
Thank you! :)