mirror of
https://github.com/clangen/musikcube.git
synced 2025-03-29 19:20:28 +00:00
Ensure se free shcore.dll after loading it dynamically to ensure dpi
scaling is properly configured.
This commit is contained in:
parent
aad227681d
commit
8344255b18
@ -257,14 +257,16 @@ namespace cursespp {
|
||||
typedef HRESULT(__stdcall *SetProcessDpiAwarenessProc)(int);
|
||||
static const int ADJUST_DPI_PER_MONITOR = 2;
|
||||
|
||||
HMODULE dll = LoadLibrary(L"shcore.dll");
|
||||
if (dll) {
|
||||
HMODULE shcoreDll = LoadLibrary(L"shcore.dll");
|
||||
if (shcoreDll) {
|
||||
SetProcessDpiAwarenessProc setDpiAwareness =
|
||||
(SetProcessDpiAwarenessProc) GetProcAddress(dll, "SetProcessDpiAwareness");
|
||||
(SetProcessDpiAwarenessProc) GetProcAddress(shcoreDll, "SetProcessDpiAwareness");
|
||||
|
||||
if (setDpiAwareness) {
|
||||
setDpiAwareness(ADJUST_DPI_PER_MONITOR);
|
||||
}
|
||||
|
||||
FreeLibrary(shcoreDll);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user