From b50e1fcbfcc9a9bcfd2baa255dcf702e8e00c85e Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Wed, 21 Apr 2021 08:49:34 +0200 Subject: [PATCH] + fix: rendering of "Relaunch Elevated" menu icon --- src/Dialogs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Dialogs.c b/src/Dialogs.c index d9880f097..cbe5c0417 100644 --- a/src/Dialogs.c +++ b/src/Dialogs.c @@ -5977,13 +5977,13 @@ HBITMAP ResampleIconToBitmap(HWND hwnd, HBITMAP hOldBmp, const HICON hIcon, cons // void SetUACIcon(HWND hwnd, const HMENU hMenu, const UINT nItem) { - static UINT dpi = USER_DEFAULT_SCREEN_DPI; + static UINT dpi = 0; // (!) initially, to force first calculation static MENUITEMINFO mii = { 0 }; UINT const cur_dpi = Scintilla_GetWindowDPI(hwnd); if (dpi != cur_dpi) { - dpi = cur_dpi; + int const scx = Scintilla_GetSystemMetricsForDpi(SM_CXSMICON, dpi); int const scy = Scintilla_GetSystemMetricsForDpi(SM_CYSMICON, dpi); @@ -5996,8 +5996,8 @@ void SetUACIcon(HWND hwnd, const HMENU hMenu, const UINT nItem) if (mii.hbmpItem) { DeleteObject(mii.hbmpItem); } - mii.hbmpItem = ConvertIconToBitmap(Globals.hIconMsgShield, scx, scy); + dpi = cur_dpi; SetMenuItemInfo(hMenu, nItem, FALSE, &mii); }