[PB 6.10beta6] Window overlaps taskbar on Windows 11

Just starting out? Need help? Post your questions and find answers here.
User avatar
marcoagpinto
Addict
Addict
Posts: 1076
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

[PB 6.10beta6] Window overlaps taskbar on Windows 11

Post 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.
fryquez
Enthusiast
Enthusiast
Posts: 391
Joined: Mon Dec 21, 2015 8:12 pm

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

Post 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
breeze4me
Enthusiast
Enthusiast
Posts: 633
Joined: Thu Mar 09, 2006 9:24 am
Location: S. Kor

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

Post 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
User avatar
marcoagpinto
Addict
Addict
Posts: 1076
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

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

Post 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!
Fred
Administrator
Administrator
Posts: 18351
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

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

Post by Fred »

Why opening another topic for the same issue ?
User avatar
marcoagpinto
Addict
Addict
Posts: 1076
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

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

Post 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.
Post Reply