make dpi awareness code compatible with windows7

This commit is contained in:
Kang Yu 2023-07-28 14:35:02 -07:00
parent 655677ce72
commit c5dd09c05d
5 changed files with 15 additions and 6 deletions

View file

@ -10,7 +10,7 @@ namespace PersistentWindows.Common
public string db_entry_name = null;
public NameDbEntry()
{
User32.SetThreadDpiAwarenessContext(User32.DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
User32.SetThreadDpiAwarenessContextSafe(User32.DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
InitializeComponent();
}