extended desktop positioning

BlitzMax Forums/MaxGUI Module/extended desktop positioning

PantsOn(Posted 2008) [#1]
Hi

To place a window in the middle of the desktop, I would use something like the following
x:int = (clientwidth(desktop())-200) / 2
y:int = (clientheight(desktop())-200) / 2
wndw:tgadget = createwindow("hello",x,y,200,200)

That all works well on a single desktop.
Co-ord positions start at the primary monitors top left.

If I extended my desktop to a second monitor, it only works if the primary desktop is in the top left hand corner. (otherwise my second monitor has negative screen co-ords)

Is there a way of detecting that the second monitor is 'before' the first.
working....
+-----+ +-----+
| 1ST | | 2ND |
+-----+ +-----+

not working...
+-----+
| 2ND |
+-----+
+-----+
| 1ST |
+-----+


cheers


d-bug(Posted 2008) [#2]
Okay, I know that this post is rather old, but hey, I don't look at all posts over here... ;)

At least there is a solution for Windows. Import DesktopExtension module and use DesktopX(0) and DesktopY(0) to retreive coords of the primary display.

Import chaos.desktopext

Local X:Int = DesktopX(0) + (DesktopWidth(0)/2) - 100 'use 0 to enshure primary display
Local Y:Int = DesktopY(0) + (DesktopHeight(0)/2) - 100 'use 0 to enshure primary display

Local Window:TGadget = CreateWindow ("hello", X, Y, 200, 200)


To confirm, that the secondary display is left or on top of the primary:
Import chaos.desktopext

For Local i:Int = 0 To DesktopCount ()
   Print "Display "+i+" is at position "+DesktopX(i)+","+DesktopY(i)
Next



PantsOn(Posted 2008) [#3]
Okay, I know that this post is rather old, but hey, I don't look at all posts over here... ;)

Yeah i had given up hope ;-)

many thanks for this.. I will test it out.