diff --git a/src/rufus.c b/src/rufus.c index 5055fa6e..0d652b59 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -3155,8 +3155,9 @@ relaunch: ChangeWindowMessageFilter(WM_COPYGLOBALDATA, MSGFLT_ADD); // Set the hook to automatically close Windows' "You need to format the disk in drive..." prompt + SetAlertPromptMessages(); if (!SetAlertPromptHook()) - uprintf("Warning: Could not set alert prompts hook"); + uprintf("Warning: Could not set alert prompt hook"); ShowWindow(hDlg, SW_SHOWNORMAL); UpdateWindow(hDlg); diff --git a/src/rufus.h b/src/rufus.h index 0d282d58..fc3edf45 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -567,6 +567,7 @@ extern BOOL IsBufferInDB(const unsigned char* buf, const size_t len); extern char* _printbits(size_t const size, void const * const ptr, int leading_zeroes); extern BOOL IsCurrentProcessElevated(void); extern char* GetCurrentMUI(void); +extern void SetAlertPromptMessages(void); extern BOOL SetAlertPromptHook(void); extern void ClrAlertPromptHook(void); extern BYTE SearchProcess(char* HandleName, DWORD dwTimeout, BOOL bPartialMatch, BOOL bIgnoreSelf, BOOL bQuiet); diff --git a/src/rufus.rc b/src/rufus.rc index 6898deeb..6aae42c0 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 232, 326 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_ACCEPTFILES -CAPTION "Rufus 3.5.1457" +CAPTION "Rufus 3.5.1458" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -394,8 +394,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,5,1457,0 - PRODUCTVERSION 3,5,1457,0 + FILEVERSION 3,5,1458,0 + PRODUCTVERSION 3,5,1458,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -413,13 +413,13 @@ BEGIN VALUE "Comments", "https://akeo.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "3.5.1457" + VALUE "FileVersion", "3.5.1458" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2019 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus-3.5.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.5.1457" + VALUE "ProductVersion", "3.5.1458" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index f122779f..28c82cc2 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -1977,14 +1977,11 @@ static void CALLBACK AlertPromptHook(HWINEVENTHOOK hWinEventHook, DWORD Event, H } } -BOOL SetAlertPromptHook(void) +void SetAlertPromptMessages(void) { HMODULE mui_lib; char mui_path[MAX_PATH]; - if (ap_weh != NULL) - return TRUE; // No need to set again if active - // Fetch the localized strings in the relevant MUI static_sprintf(mui_path, "%s\\%s\\shell32.dll.mui", system_dir, GetCurrentMUI()); mui_lib = LoadLibraryU(mui_path); @@ -2013,7 +2010,12 @@ BOOL SetAlertPromptHook(void) FreeLibrary(mui_lib); } static_strcpy(title_str[2], lmprintf(MSG_149)); +} +BOOL SetAlertPromptHook(void) +{ + if (ap_weh != NULL) + return TRUE; // No need to set again if active ap_weh = SetWinEventHook(EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND, NULL, AlertPromptHook, 0, 0, WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS); return (ap_weh != NULL);