From ad3fb8d3809f7975df33ea5753f4e1454b6d1f3a Mon Sep 17 00:00:00 2001 From: hyzboy Date: Tue, 15 Mar 2022 18:02:57 +0800 Subject: [PATCH] deleted HDPI support in front of CreateWindowEx, use mainifest mode instead of. --- src/Win/WinWindow.cpp | 18 +----------------- src/Win/WinWindow.h | 12 ------------ 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/src/Win/WinWindow.cpp b/src/Win/WinWindow.cpp index 92c9040..4b67661 100644 --- a/src/Win/WinWindow.cpp +++ b/src/Win/WinWindow.cpp @@ -38,19 +38,6 @@ namespace hgl int win_left, win_top; int win_width, win_height; - - WindowCreateExteraParams createParams; - - { - context = DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2; - previousDpiContext = SetThreadDpiAwarenessContext(context); - - createParams.bEnableNonClientDpiScaling = FALSE; - createParams.bChildWindowDpiIsolation = TRUE; - - previousDpiHostingBehavior = SetThreadDpiHostingBehavior(DPI_HOSTING_BEHAVIOR_MIXED); - } - { RECT win_rect; @@ -89,7 +76,7 @@ namespace hgl nullptr, // handle to parent nullptr, // handle to menu hInstance, // hInstance - &createParams); // extra parameters + nullptr); // extra parameters if (!win_hwnd) { @@ -166,9 +153,6 @@ namespace hgl { ShowWindow(win_hwnd, SW_SHOW); - SetThreadDpiAwarenessContext(previousDpiContext); - SetThreadDpiHostingBehavior(previousDpiHostingBehavior); - SetForegroundWindow(win_hwnd); SetFocus(win_hwnd); diff --git a/src/Win/WinWindow.h b/src/Win/WinWindow.h index fe3f52b..7401847 100644 --- a/src/Win/WinWindow.h +++ b/src/Win/WinWindow.h @@ -3,12 +3,6 @@ #include namespace hgl { - struct WindowCreateExteraParams - { - BOOL bEnableNonClientDpiScaling; - BOOL bChildWindowDpiIsolation; - }; - /** * Windows平台窗口实现 */ @@ -20,12 +14,6 @@ namespace hgl MSG win_msg; - private: - - DPI_AWARENESS_CONTEXT context; - DPI_AWARENESS_CONTEXT previousDpiContext; - DPI_HOSTING_BEHAVIOR previousDpiHostingBehavior; - protected: bool Create();