Page 2 of 2

Re: Open new window with same height and Y position as anoth

Posted: Sun Aug 28, 2016 2:18 pm
by DontTalkToMe
@rashad

that work for y, but the windows are not positioned at 200 and 300.

Anyway all these are just workarounds for a specific problem, the point is you don't get reliable information when using PB commands to query windows' metrics. The numbers you work with do not reflect the reality when you go to actually measure them, it's a problem when you need pixel perfect positioning of something.

try with your code

Code: Select all

Debug WindowX(0,#PB_Window_FrameCoordinate)
Debug WindowX(0,#PB_Window_InnerCoordinate)

Debug WindowX(1,#PB_Window_FrameCoordinate)
Debug WindowX(1,#PB_Window_InnerCoordinate)
and verify where they are in reality by counting actual pixels

Re: Open new window with same height and Y position as anoth

Posted: Sun Aug 28, 2016 5:27 pm
by RASHAD
No bug
It is how windows handle the DPI & Composition effect
With windows 10 there is a different way to handle such case
Another simple one

Code: Select all

y=200 ; Both windows should open at this vertical position!

OpenWindow(0,200,y,200,100,"Lower",#PB_Window_SystemMenu|#PB_Window_SizeGadget)
If OSVersion() > #PB_OS_Windows_Vista And OSVersion() < #PB_OS_Windows_10
  AdjustWindowRectEx_(r.RECT,#PB_Window_SizeGadget,0,0)
  AdjustWindowRectEx_(rr.RECT,#PB_Window_SystemMenu,0,0)
  yy = r\right - rr\right
EndIf
OpenWindow(1,300,y+yy,WindowWidth(0),WindowHeight(0),"Higher - why?",#PB_Window_SystemMenu)

Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow

Re: Open new window with same height and Y position as anoth

Posted: Sun Aug 28, 2016 6:09 pm
by DontTalkToMe
Right ...

still a specific workaround and still the X position of both windows is off on win7 + aero, while using API + the linker file they are correctly at 200 and 300.

passing #PB_ constants which appears (at the moment) to be more or less coincident to win32 native windows' style combinations to an API is not a good idea IMO.

My efforts stop here, it's becoming a chore :|