Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows GUI: Use older API for getting system DPI, update2 #861

Merged
merged 1 commit into from
Jun 1, 2024

Conversation

cjee21
Copy link
Collaborator

@cjee21 cjee21 commented Jun 1, 2024

Implement delayed loading of user32.dll and use GetDpiForWindow. Should work on Windows 7 to 11 now.

Tested on Windows 7 VM at 100% and 125%
Tested on Windows 11 PC at 100% and 150%

Nothing unexpected noticed, all seems fine.

@cjee21
Copy link
Collaborator Author

cjee21 commented Jun 1, 2024

🤔 maybe should use GetDpiForWindow instead

Implement delayed loading of user32.dll and use GetDpiForWindow. Should work on Windows 7 to 11 now.
@cjee21
Copy link
Collaborator Author

cjee21 commented Jun 1, 2024

Changed to GetDpiForWindow. Still works fine. Now new API works on Windows 10 Anniversary Update onwards.

@JeromeMartinez
Copy link
Member

I was not aware of ILINK_DelayLoadDll, I was implementing the dynamic load myself but this method is better.
GetDpiForWindow how many API is there for getting DPI??? :-p.

@cjee21
Copy link
Collaborator Author

cjee21 commented Jun 1, 2024

how many API is there for getting DPI??? :-p.

Many... https://learn.microsoft.com/en-us/windows/win32/hidpi/high-dpi-reference

@JeromeMartinez
Copy link
Member

Many...

😱

@JeromeMartinez
Copy link
Member

Side note: I was "flooded" (ok, not so much, but still a couple within a couple of hours) by emails / reports about Win7 despite its EOL for several years, so Win7 support is still important.
(Me remembering some complains when we stopped WinXP support due to new Visual Studio not supporting it anymore few years ago so several years after its end of life... We'll have to support Win7 for several years)

@JeromeMartinez JeromeMartinez merged commit bbfebe6 into MediaArea:master Jun 1, 2024
3 checks passed
@cjee21 cjee21 deleted the DPI-fix branch June 1, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants