diff --git a/Photino.Native/Photino.Windows.cpp b/Photino.Native/Photino.Windows.cpp index d364c28..c53feb1 100644 --- a/Photino.Native/Photino.Windows.cpp +++ b/Photino.Native/Photino.Windows.cpp @@ -69,7 +69,7 @@ void Photino::Register(HINSTANCE hInstance) RegisterClassEx(&wcx); - SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE); + SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); } Photino::Photino(PhotinoInitParams* initParams) @@ -333,6 +333,25 @@ LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } break; } + case WM_DPICHANGED: + { + UINT dpiX = HIWORD(wParam); + UINT dpiY = LOWORD(wParam); + + RECT* newWindowRect = (RECT*)lParam; + + SetWindowPos( + hwnd, + NULL, + newWindowRect->left, + newWindowRect->top, + newWindowRect->right - newWindowRect->left, + newWindowRect->bottom - newWindowRect->top, + SWP_NOZORDER | SWP_NOACTIVATE + ); + + return 0; + } case WM_SETTINGCHANGE: { if (IsColorSchemeChange(lParam))