Page 1 of 1

[PB 6.10beta6] Window overlaps taskbar on Windows 11

Posted: Wed Feb 28, 2024 4:24 am
by marcoagpinto
Heya, it is not the first time I have written about this, but this time I opened the ticket in this part of the forum so that users don't complain that 99% of my bug reports are silly.

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
The window it opens overlaps the taskbar on Windows 11.

Re: [PB 6.10beta6] Window overlaps taskbar on Windows 11

Posted: Wed Feb 28, 2024 10:00 am
by fryquez
How about that?

Code: Select all

Define rc.rect
SystemParametersInfo_(#SPI_GETWORKAREA, 0, @rc, 0)

OpenWindow(1,rc\left, rc\top, rc\right - rc\left,rc\bottom - rc\top,"")
MoveWindow_(WindowID(1), rc\left, rc\top, rc\right - rc\left,rc\bottom - rc\top, 1)

Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow

Re: [PB 6.10beta6] Window overlaps taskbar on Windows 11

Posted: Wed Feb 28, 2024 10:35 am
by breeze4me
Have you tried running my code below?
On Windows 10 and later, windows have invisible borders that make it difficult to get the exact size using the usual (simple) ways.

https://www.purebasic.fr/english/viewto ... 83#p615683

Re: [PB 6.10beta6] Window overlaps taskbar on Windows 11

Posted: Wed Feb 28, 2024 11:07 am
by marcoagpinto
breeze4me wrote: Wed Feb 28, 2024 10:35 am Have you tried running my code below?
On Windows 10 and later, windows have invisible borders that make it difficult to get the exact size using the usual (simple) ways.

https://www.purebasic.fr/english/viewto ... 83#p615683
Ahhhhh... I avoid using API as much as possible.

I thought that it could be easily fixed, so I will keep removing 10 pixels to the height if Windows 11 is being used, but then it will come Windows 12, Windows 13, etc. and it will always change.

So, no easy fix for it.

Thanks!

Re: [PB 6.10beta6] Window overlaps taskbar on Windows 11

Posted: Wed Feb 28, 2024 11:17 am
by Fred
Why opening another topic for the same issue ?

Re: [PB 6.10beta6] Window overlaps taskbar on Windows 11

Posted: Wed Feb 28, 2024 11:23 am
by marcoagpinto
Fred wrote: Wed Feb 28, 2024 11:17 am Why opening another topic for the same issue ?
Because I was stressed and didn't quite remember where it was when I created this post.

I am sorry.