From bffb61bad933aa842b583562707a6d7a4c1e3f99 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Thu, 2 Aug 2018 10:07:22 +0200 Subject: [PATCH] + del: remove obsolete GetSystemDPI() usage --- src/Dialogs.c | 6 +++--- src/Helpers.c | 21 --------------------- src/Helpers.h | 3 --- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/src/Dialogs.c b/src/Dialogs.c index 9bde2b665..6507bfebe 100644 --- a/src/Dialogs.c +++ b/src/Dialogs.c @@ -55,6 +55,7 @@ extern HINSTANCE g_hInstance; extern HMODULE g_hLngResContainer; extern LANGID g_iPrefLngLocID; extern HICON g_hDlgIcon; +extern UINT g_uCurrentDPI; extern WCHAR g_wchWorkingDirectory[]; extern WCHAR g_wchCurFile[]; @@ -465,10 +466,9 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam LOGFONT lf; GetObject(hFontTitle, sizeof(LOGFONT), &lf); - POINT dpi = GetSystemDpi(); lf.lfWeight = FW_BOLD; - lf.lfWidth = MulDiv(8, dpi.x, USER_DEFAULT_SCREEN_DPI); - lf.lfHeight = MulDiv(22, dpi.y, USER_DEFAULT_SCREEN_DPI); + lf.lfWidth = MulDiv(8, g_uCurrentDPI, USER_DEFAULT_SCREEN_DPI); + lf.lfHeight = MulDiv(22, g_uCurrentDPI, USER_DEFAULT_SCREEN_DPI); // lf.lfQuality = ANTIALIASED_QUALITY; hFontTitle = CreateFontIndirect(&lf); diff --git a/src/Helpers.c b/src/Helpers.c index cc5f04bbc..bb90202bd 100644 --- a/src/Helpers.c +++ b/src/Helpers.c @@ -627,27 +627,6 @@ bool IsFontAvailable(LPCWSTR lpszFontName) } - -//============================================================================= -// -// SetWindowTitle() -// -POINT GetSystemDpi() -{ - POINT result; - - HDC hDC = GetDC(NULL); - - result.x = GetDeviceCaps(hDC, LOGPIXELSX); - result.y = GetDeviceCaps(hDC, LOGPIXELSY); - - ReleaseDC(NULL, hDC); - - return result; -} - - - //============================================================================= // // SetWindowTitle() diff --git a/src/Helpers.h b/src/Helpers.h index f865f111f..d76cd301f 100644 --- a/src/Helpers.h +++ b/src/Helpers.h @@ -146,13 +146,10 @@ bool BitmapAlphaBlend(HBITMAP,COLORREF,BYTE); bool BitmapGrayScale(HBITMAP); bool VerifyContrast(COLORREF,COLORREF); bool IsFontAvailable(LPCWSTR); -POINT GetSystemDpi(); - bool SetWindowTitle(HWND,UINT,bool,UINT,LPCWSTR,int,bool,UINT,bool,LPCWSTR); void SetWindowTransparentMode(HWND,bool); - void CenterDlgInParent(HWND); void GetDlgPos(HWND,LPINT,LPINT); void SetDlgPos(HWND,int,int);