MS Windows -> Affichage %

Salut,

Est-on capable de lire la boite à cocher du thème affichage ?

[]27538076;“Your comment here…”[/]

Hello,

I just posted this which should give you the desired info:

https://github.com/miyako/4d-plugin-get-dpi-v2

there are several basic things to know about DPI.

Windows paraphrases DPI as zoom percentage in their control panel dialog, for simplicity.

https://docs.microsoft.com/en-us/windows/desktop/hidpi/wm-dpichanged

100% = 96 DPI (USER_DEFAULT_SCREEN_DPI)
200% = 192 DPI

and so on.

there are 3 levels of DPI awareness for a Win32 application.

https://docs.microsoft.com/en-us/windows/desktop/api/ShellScalingApi/ne-shellscalingapi-process_dpi_awareness

unaware (this is 4D) which means the system maps the true DPI to a virtual 96 DPI system,
so the app can be ignorant about the true DPI.
the result, of course, is that the app appears blurry.

system, which means the app must work on the true DPI (system level),
by multiplying the font size, window size, object size, icon size, everything.
it must also respond to DPI change events during session.

monitor, which is similar to system, but more granular.

unaware is a good default for 4D, because otherwise, every thing would look very small (same as 100%) on a high definition monitor.

some frameworks like WPF support DPI at the framework level,
but you don’t typically design your UI with a GUI WYSIWYG editor like 4D.
you write it using XML (XAML).

just like a good HTML should not use absolute positioning for design.

https://en.wikipedia.org/wiki/Windows_Presentation_Foundation

anyway, because 4D is unaware, any system API calls to request the DPI for the https://docs.microsoft.com/en-us/windows/desktop/api/ShellScalingAPI/nf-shellscalingapi-getdpiformonitorsystem> or a https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-getdpiforwindowwindow> will always return 96, the virtual DPI.

so the plugin calls a function to temporarily change the thread DPI awareness, pokes the system DPI, then reverts to unaware.

but again, the principle is that you shouldn’t need this information, because 4D is always working in a virtual 96 DPI space.

: Keisuke MIYAKO

but again, the principle is that you shouldn’t need this information,
because 4D is always working in a virtual 96 DPI space.

With my little experience, 4D Apps don’t work/look correctly if user is in 125%…
So it could be useful to know that preference and alert the user that the app will NOT work as expected.

: Manuel PIQUET
: Keisuke MIYAKO

but again, the principle is that you shouldn’t need this information,
because 4D is always working in a virtual 96 DPI space.

With my little experience, 4D Apps don’t work/look correctly if user
is in 125%…
So it could be useful to know that preference and alert the user that
the app will NOT work as expected.

That is my aim