Merge pull request #570 from RaiKoHoff/Dev_ChngDPI

Remove obsolete GetSystemDPI() usage
This commit is contained in:
Rainer Kottenhoff 2018-08-02 10:29:46 +02:00 committed by GitHub
commit 798fa1bf4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 27 deletions

View File

@ -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);

View File

@ -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()

View File

@ -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);