From 766388c552a4b04fa62b3874fe841c87f6ca66ac Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 17 Aug 2021 16:36:56 +0800 Subject: [PATCH] wordpad: Use large icons for toolbar when DPI is greater than 120. Signed-off-by: Zhiyi Zhang Signed-off-by: Alexandre Julliard --- programs/wordpad/wordpad.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c index d48346e3c4a..e87475ad06b 100644 --- a/programs/wordpad/wordpad.c +++ b/programs/wordpad/wordpad.c @@ -1881,7 +1881,7 @@ static LRESULT OnCreate( HWND hWnd ) HFONT font; HDC hdc; SIZE name_sz, size_sz; - int height; + int height, dpi; static const WCHAR wszRichEditDll[] = {'R','I','C','H','E','D','2','0','.','D','L','L','\0'}; static const WCHAR wszRichEditText[] = {'R','i','c','h','E','d','i','t',' ','t','e','x','t','\0'}; static const WCHAR font_text[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n',0}; /* a long font name */ @@ -1905,8 +1905,12 @@ static LRESULT OnCreate( HWND hWnd ) NULL, 0, 24, 24, 16, 16, sizeof(TBBUTTON)); + hdc = GetDC(hWnd); + dpi = GetDeviceCaps(hdc, LOGPIXELSY); + ReleaseDC(hWnd, hdc); + ab.hInst = HINST_COMMCTRL; - ab.nID = IDB_STD_SMALL_COLOR; + ab.nID = dpi >= 120 ? IDB_STD_LARGE_COLOR : IDB_STD_SMALL_COLOR; nStdBitmaps = SendMessageW(hToolBarWnd, TB_ADDBITMAP, 0, (LPARAM)&ab); AddButton(hToolBarWnd, nStdBitmaps+STD_FILENEW, ID_FILE_NEW);