mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
+ fix: rendering of "Relaunch Elevated" menu icon
This commit is contained in:
parent
4288193460
commit
b50e1fcbfc
@ -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);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user