Rename GetWindowScalingFactor() to Win_GetW.., support older Win versions

Minimum required Windows version is XP again (instead of Win10).
Win_GetWindowScalingFactor() tries to use two dynamically loaded functions
from newer windows versions (8.1+, Win10 1607+) and has a fallback for
older versions that also seems to work (at least if all displays have
the same DPI).

Moved the function to win_main.cpp so the dynamically loaded functions
can be loaded at startup; so edit_gui_common.cpp could be removed again.
This commit is contained in:
Daniel Gibson 2021-05-10 03:17:26 +02:00
parent e67b77ba5d
commit c3d480afe4
24 changed files with 98 additions and 65 deletions

View file

@ -103,7 +103,7 @@ void CPropTreeView::OnPaint()
}
void CPropTreeView::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) {
float scaling_factor = GetWindowScalingFactor(GetSafeHwnd());
float scaling_factor = Win_GetWindowScalingFactor(GetSafeHwnd());
int s20 = int(20 * scaling_factor);
// #HvGNote : This should be the right way to do it, but hardcoded is fine too.