diff --git a/appshell/cef_window.cpp b/appshell/cef_window.cpp index 88139d748..1fd261cd4 100644 --- a/appshell/cef_window.cpp +++ b/appshell/cef_window.cpp @@ -359,5 +359,6 @@ UINT cef_window::GetDPIScalingX() const float lpx = dc ? GetDeviceCaps(dc,LOGPIXELSX):DEFAULT_WINDOWS_DPI ; //scale factor as it would look in a default(96dpi) screen. the default will be always 96 logical DPI when scaling is applied in windows. //see. https://msdn.microsoft.com/en-us/library/ms701681(v=vs.85).aspx + ReleaseDC(dc); return (lpx/DEFAULT_WINDOWS_DPI)*100; } \ No newline at end of file diff --git a/appshell/cef_window.h b/appshell/cef_window.h index cf6f3a9e8..a27bdb9a6 100644 --- a/appshell/cef_window.h +++ b/appshell/cef_window.h @@ -173,7 +173,7 @@ class cef_window HDC GetDC() const { return ::GetDC(mWnd); } - int ReleaseDC(HDC dc) + int ReleaseDC(HDC dc) const { return ::ReleaseDC(mWnd, dc); } BOOL SetWindowPos(cef_window* insertAfter, int x, int y, int cx, int cy, UINT uFlags)