[loc] fix alert hook handling when switching language

* Because the localized title/button text lookup was only executed once
  on startup, it wouldn't apply to the new language on relaunch. Fix that.
This commit is contained in:
Pete Batard 2019-03-13 17:01:26 +00:00
parent 7e21f8a60c
commit 924c6b1a79
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
4 changed files with 14 additions and 10 deletions

View file

@ -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);