Thanks Dude and Rashad, but still not correctly displayed here (Win 8.1)...
...the real position of the two windows is different to the values which are shown below:
Code: Select all
0:
100 - 100
103 - 126
100 - 306, 100 - 329
1:
100 - 100
101 - 129
95 - 307, 100 - 335
But... the outer frame of window #0 is on the screen position
[97|97] while the left top corner of window #1 is at
[95 | 100 ]. The real window sizes of both windows is 212 x 235. That means, if the window #1 would have been opened with the parameters (1,102,97,200,200,"1",...) it would be placed exactly on top of window #0.
Code: Select all
Macro ShowDim(r)
Debug Str(r\left)+" - "+Str(r\right)+", "+Str(r\top)+" - "+Str(r\bottom)
EndMacro
OpenWindow(0,100,100,200,200,"0",#PB_Window_SystemMenu)
OpenWindow(1,100,100,200,200,"1",#PB_Window_SystemMenu|#PB_Window_SizeGadget)
GetWindowRect_(WindowID(0),w0.rect)
GetWindowRect_(WindowID(1),w1.rect)
Debug "0:"
Debug Str(WindowX(0,#PB_Window_FrameCoordinate)) + " - " + Str(WindowY(0,#PB_Window_FrameCoordinate))
Debug Str(WindowX(0,#PB_Window_InnerCoordinate)) + " - " + Str(WindowY(0,#PB_Window_InnerCoordinate))
ShowDim(w0)
Debug "1:"
Debug Str(WindowX(1,#PB_Window_FrameCoordinate)) + " - " + Str(WindowY(1,#PB_Window_FrameCoordinate))
Debug Str(WindowX(1,#PB_Window_InnerCoordinate)) + " - " + Str(WindowY(1,#PB_Window_InnerCoordinate))
ShowDim(w1)
;ResizeWindow(1,WindowX(0)+w0\right-w0\left,WindowY(0)+w0\bottom-w0\top-w1\bottom+w1\top,#PB_Ignore,#PB_Ignore)
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
For my windows here, the following code works perfect - no idea if it will produce strange results for other windows releases...
...Window 1 is placed exactly above window 0, window 2 is also perfectly arranged on the right side of (the hidden) window 0:
Code: Select all
OpenWindow(0,100,100,200,200,"0",#PB_Window_SystemMenu)
OpenWindow(1,100,100,200,200,"1",#PB_Window_SystemMenu|#PB_Window_SizeGadget)
OpenWindow(2,100,100,200,200,"2",#PB_Window_SystemMenu|#PB_Window_SizeGadget)
GetWindowRect_(WindowID(0),w0.rect)
GetWindowRect_(WindowID(1),w1.rect)
ox=WindowX(0,#PB_Window_InnerCoordinate)-WindowX(1,#PB_Window_InnerCoordinate)
oy=WindowY(0,#PB_Window_InnerCoordinate)-WindowY(1,#PB_Window_InnerCoordinate)
oz=w1\right-w1\left-(w0\right-w0\left)
oz=w1\right-w1\left-WindowWidth(0)
Debug ox
Debug oy
Debug oz
ResizeWindow(1,WindowX(1)+ox,WindowY(1)+oy,#PB_Ignore,#PB_Ignore); window 1 over window 0
ResizeWindow(2,WindowX(0)+WindowWidth(0)+oz+ox,WindowY(0)+oy,#PB_Ignore,#PB_Ignore); window 0 and 2 side to side
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow