Trouble is unless I include the #pb_window_sizegadget in the second window command then the resize command that is used to position the window in the corner actually moves the window slightly to the left and up.
The reason for the resize command is because the #pb_screen_centered part is not actually centering on the client area but on the whole screen, but that's another story.
Also, this code seems to work if the taskbar is on the bottom or right of the screen but if it's on the top or left then a full screen sized window gets created.
Code: Select all
OpenWindow(0,0,0,200,200,"",#PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_Invisible)
GetWindowRect_(WindowID(0),win.RECT)
widthtoadd=(win\right-win\left)-200
heighttoadd=(win\bottom-win\top)-200
SystemParametersInfo_(#SPI_GETWORKAREA,0,@screen.RECT,0)
windowwidth = screen\right-widthtoadd
windowheight = screen\bottom-heighttoadd
CloseWindow(0)
OpenWindow(0,0,0,WindowWidth,WindowHeight,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
;ResizeWindow(0,0,0,#PB_Ignore,#PB_Ignore)
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
Or how do you stop a window from being resized when you have to include the #pb_window_sizegadget?