Try the following code on Windows 11:
Code: Select all
; Get maximum width possible for a window
If OpenWindow(3000,0,0,10,10,"Getting Maximum Window Size",#PB_Window_Maximize|#PB_Window_Invisible|#PB_Window_MaximizeGadget)=0 : MessageRequester("Error", "Can't open a window.",#PB_MessageRequester_Error) : EndIf
max_width=WindowWidth(3000)
CloseWindow(3000)
; Get maximum height possible for a window
If OpenWindow(3000,0,0,10,10,"Getting Maximum Window Size",#PB_Window_Maximize|#PB_Window_Invisible|#PB_Window_MaximizeGadget)=0 : MessageRequester("Error", "Can't open a window.",#PB_MessageRequester_Error) : EndIf
max_height=WindowHeight(3000)
CloseWindow(3000)
; Open a window with the data above
OpenWindow(1,0,0,max_width,max_height,"It overlaps the task bar")
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow


