Page 1 of 1

blank space in the window when calling the window screen api, after setting the windows 11 resolution scale to 125%

Posted: Wed Oct 16, 2024 8:13 pm
by skinkairewalker
I noticed that if I set the Windows 11 resolution scale to 125%, there is a blank space after calling OpenWindowedScreen

If I set it back to 100%, apparently the problem is fixed.to solve, I decided to multiply the resolution *0.80 ( I don't know if this makes any mathematical sense or if it's just a coincidence of my monitor... )

is anyone else having the same problem?

screenshot : https://prnt.sc/lpJE0B-M5HcY

Re: blank space in the window when calling the window screen api, after setting the windows 11 resolution scale to 125%

Posted: Thu Oct 17, 2024 7:13 am
by jacdelad
...and you didn't forget to enable the dpi aware setting? In other words: Does the same happen happen when you flip the dpi aware option?

Re: blank space in the window when calling the window screen api, after setting the windows 11 resolution scale to 125%

Posted: Thu Oct 17, 2024 8:22 am
by Fred
The OpenWindowedScreen() dimensions are in real pixels, so if you create a DPI aware executable, you need to adjust it with DesktopScaledX/Y(). When DPI flag is on, all the window/gadget x,y,width/height are in virtual pixels (always like 100% DPI).

Re: blank space in the window when calling the window screen api, after setting the windows 11 resolution scale to 125%

Posted: Thu Oct 17, 2024 5:53 pm
by skinkairewalker
Awesome jacdelad and Fred !
Thank you for the knowledge, as the saying goes: 'live and learn.'