mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Windowing: Avoid dynamically loading SetProcessDpiAwareness, which is always present on Windows 8.1
This commit is contained in:
parent
09ae83a367
commit
f1d215f014
1 changed files with 3 additions and 8 deletions
|
|
@ -344,7 +344,6 @@ static void checkForPointerAPI()
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
using SetProcessDPIAwarenessFunc = HRESULT (WINAPI*) (DPI_Awareness);
|
||||
using SetThreadDPIAwarenessContextFunc = DPI_AWARENESS_CONTEXT (WINAPI*) (DPI_AWARENESS_CONTEXT);
|
||||
using GetSystemMetricsForDpiFunc = int (WINAPI*) (int, UINT);
|
||||
using GetProcessDPIAwarenessFunc = HRESULT (WINAPI*) (HANDLE, DPI_Awareness*);
|
||||
|
|
@ -353,7 +352,6 @@ using GetThreadDPIAwarenessContextFunc = DPI_AWARENESS_CONTEXT (WINAPI*)
|
|||
using GetAwarenessFromDpiAwarenessContextFunc = DPI_Awareness (WINAPI*) (DPI_AWARENESS_CONTEXT);
|
||||
using EnableNonClientDPIScalingFunc = BOOL (WINAPI*) (HWND);
|
||||
|
||||
static SetProcessDPIAwarenessFunc setProcessDPIAwareness = nullptr;
|
||||
static SetThreadDPIAwarenessContextFunc setThreadDPIAwarenessContext = nullptr;
|
||||
static GetProcessDPIAwarenessFunc getProcessDPIAwareness = nullptr;
|
||||
static GetWindowDPIAwarenessContextFunc getWindowDPIAwarenessContext = nullptr;
|
||||
|
|
@ -372,8 +370,6 @@ static void loadDPIAwarenessFunctions()
|
|||
if (shcoreModule == nullptr)
|
||||
return;
|
||||
|
||||
setProcessDPIAwareness = (SetProcessDPIAwarenessFunc) GetProcAddress (shcoreModule, "SetProcessDpiAwareness");
|
||||
|
||||
#if JUCE_WIN_PER_MONITOR_DPI_AWARE
|
||||
getProcessDPIAwareness = (GetProcessDPIAwarenessFunc) GetProcAddress (shcoreModule, "GetProcessDpiAwareness");
|
||||
getWindowDPIAwarenessContext = (GetWindowDPIAwarenessContextFunc) getUser32Function ("GetWindowDpiAwarenessContext");
|
||||
|
|
@ -399,12 +395,11 @@ static void setDPIAwareness()
|
|||
if (SetProcessDpiAwarenessContext (DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2))
|
||||
return;
|
||||
|
||||
if (setProcessDPIAwareness != nullptr && enableNonClientDPIScaling != nullptr
|
||||
&& SUCCEEDED (setProcessDPIAwareness (DPI_Awareness::DPI_Awareness_Per_Monitor_Aware)))
|
||||
if (enableNonClientDPIScaling != nullptr
|
||||
&& SUCCEEDED (SetProcessDpiAwareness (PROCESS_PER_MONITOR_DPI_AWARE)))
|
||||
return;
|
||||
|
||||
if (setProcessDPIAwareness != nullptr
|
||||
&& SUCCEEDED (setProcessDPIAwareness (DPI_Awareness::DPI_Awareness_System_Aware)))
|
||||
if (SUCCEEDED (SetProcessDpiAwareness (PROCESS_SYSTEM_DPI_AWARE)))
|
||||
return;
|
||||
|
||||
SetProcessDPIAware();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue