mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
Merge pull request #570 from RaiKoHoff/Dev_ChngDPI
Remove obsolete GetSystemDPI() usage
This commit is contained in:
commit
798fa1bf4d
@ -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);
|
||||
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user