diff --git a/Versions/build.txt b/Versions/build.txt index 4ded4e723..69b6277ff 100644 --- a/Versions/build.txt +++ b/Versions/build.txt @@ -1 +1 @@ -2683 +2684 diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index 3c364de81..f63d31c50 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 BETA diff --git a/src/Dialogs.c b/src/Dialogs.c index e00e6da43..377db894a 100644 --- a/src/Dialogs.c +++ b/src/Dialogs.c @@ -226,27 +226,24 @@ static INT_PTR CALLBACK _InfoBoxLngDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPINFOBOXLNG const lpMsgBox = (LPINFOBOXLNG)lParam; - int const cx = GetSystemMetrics(SM_CXSMICON); - int const cy = GetSystemMetrics(SM_CYSMICON); - UINT const fuLoad = LR_DEFAULTCOLOR | LR_SHARED; switch (lpMsgBox->uType & MB_ICONMASK) { case MB_ICONQUESTION: - SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)LoadImage(NULL, MAKEINTRESOURCE(OIC_QUES), IMAGE_ICON, cx, cy, fuLoad), 0); + SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)Globals.hIconMsgQuest, 0); break; case MB_ICONWARNING: // = MB_ICONEXCLAMATION - SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)LoadImage(NULL, MAKEINTRESOURCE(OIC_WARNING), IMAGE_ICON, cx, cy, fuLoad), 0); + SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)Globals.hIconMsgWarn, 0); break; case MB_ICONERROR: // = MB_ICONSTOP, MB_ICONHAND - SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)LoadImage(NULL, MAKEINTRESOURCE(OIC_ERROR), IMAGE_ICON, cx, cy, fuLoad), 0); + SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)Globals.hIconMsgError, 0); break; case MB_USERICON: SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)Globals.hIcon48, 0); break; case MB_ICONINFORMATION: // = MB_ICONASTERISK default: - SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)LoadImage(NULL, MAKEINTRESOURCE(OIC_INFORMATION), IMAGE_ICON, cx, cy, fuLoad), 0); + SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)Globals.hIconMsgInfo, 0); break; } diff --git a/src/Notepad3.c b/src/Notepad3.c index e2e69bd7c..eba116d3f 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -875,17 +875,41 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, s_hRichEdit = LoadLibrary(L"MSFTEDIT.DLL"); // Use "RichEdit50W" for control in common_res.h } + int const cxs = GetSystemMetrics(SM_CXSMICON); + int const cys = GetSystemMetrics(SM_CYSMICON); + + int const cxl = GetSystemMetrics(SM_CXICON); + int const cyl = GetSystemMetrics(SM_CYICON); + + //UINT const fuLoad = LR_DEFAULTCOLOR | LR_SHARED; + if (!Globals.hDlgIcon) { - Globals.hDlgIcon = LoadImage(hInstance, MAKEINTRESOURCE(IDR_MAINWND), IMAGE_ICON, - GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR | LR_SHARED); + LoadIconWithScaleDown(hInstance, MAKEINTRESOURCE(IDR_MAINWND), cxs, cys, &(Globals.hDlgIcon)); } - if (!Globals.hIcon48) { - Globals.hIcon48 = LoadImage(hInstance, MAKEINTRESOURCE(IDR_MAINWND), IMAGE_ICON, 48, 48, LR_DEFAULTCOLOR | LR_SHARED); + LoadIconWithScaleDown(hInstance, MAKEINTRESOURCE(IDR_MAINWND), cxl, cxl, &(Globals.hIcon48)); + } + if (!Globals.hIcon128) { + LoadIconWithScaleDown(hInstance, MAKEINTRESOURCE(IDR_MAINWND), 128, 128, &(Globals.hIcon128)); } - if (!Globals.hIcon128) { - Globals.hIcon128 = LoadImage(hInstance, MAKEINTRESOURCE(IDR_MAINWND), IMAGE_ICON, 128, 128, LR_DEFAULTCOLOR | LR_SHARED); + if (!Globals.hIconMsgInfo) { + LoadIconWithScaleDown(NULL, IDI_INFORMATION, cxl, cyl, &(Globals.hIconMsgInfo)); + } + if (!Globals.hIconMsgWarn) { + LoadIconWithScaleDown(NULL, IDI_WARNING, cxl, cyl, &(Globals.hIconMsgWarn)); + } + if (!Globals.hIconMsgError) { + LoadIconWithScaleDown(NULL, IDI_ERROR, cxl, cyl, &(Globals.hIconMsgError)); + } + if (!Globals.hIconMsgQuest) { + LoadIconWithScaleDown(NULL, IDI_QUESTION, cxl, cyl, &(Globals.hIconMsgQuest)); + } + if (!Globals.hIconMsgShield) { + LoadIconWithScaleDown(NULL, IDI_SHIELD, cxl, cyl, &(Globals.hIconMsgShield)); + } + if (!Globals.hIconMsgWinLogo) { + LoadIconWithScaleDown(NULL, IDI_SHIELD, cxl, cyl, &(Globals.hIconMsgWinLogo)); } // Command Line Help Dialog @@ -9992,6 +10016,7 @@ bool FileSave(bool bSaveAlways, bool bAsk, bool bSaveAs, bool bSaveCopy, bool bP GetLngString(IDS_MUI_UNTITLED, tch, COUNTOF(tch)); } + switch (MessageBoxLng(Globals.hwndMain, MB_YESNOCANCEL | MB_ICONWARNING, IDS_MUI_ASK_SAVE, tch)) { case IDCANCEL: diff --git a/src/TypeDefs.h b/src/TypeDefs.h index b36b399eb..7a36fb0c8 100644 --- a/src/TypeDefs.h +++ b/src/TypeDefs.h @@ -300,6 +300,12 @@ typedef struct _globals_t HICON hDlgIcon; HICON hIcon48; HICON hIcon128; + HICON hIconMsgInfo; + HICON hIconMsgWarn; + HICON hIconMsgError; + HICON hIconMsgQuest; + HICON hIconMsgShield; + HICON hIconMsgWinLogo; HWND hwndDlgFindReplace; HWND hwndDlgCustomizeSchemes; int iDefaultCharSet; diff --git a/src/VersionEx.h b/src/VersionEx.h index 52a036bf6..de48cb852 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -8,8 +8,8 @@ #define SAPPNAME "Notepad3" #define VERSION_MAJOR 5 #define VERSION_MINOR 19 -#define VERSION_REV 1121 -#define VERSION_BUILD 2683 +#define VERSION_REV 1122 +#define VERSION_BUILD 2684 #define SCINTILLA_VER 421 #define ONIGURUMA_REGEX_VER 6.9.4 #define UCHARDET_VER 2018.09.27