From 5a0b6ba945cbbf543a5b8c6169fc3b2ee03e740f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 24 Mar 2022 13:24:44 +0300 Subject: MessageBox -> MessageBoxW --- src/mir_app/src/FontOptions.cpp | 4 ++-- src/mir_app/src/clistgroups.cpp | 4 ++-- src/mir_app/src/clui.cpp | 2 +- src/mir_app/src/db_ini.cpp | 2 +- src/mir_app/src/findadd.cpp | 8 ++++---- src/mir_app/src/meta_addto.cpp | 12 ++++++------ src/mir_app/src/meta_edit.cpp | 4 ++-- src/mir_app/src/meta_menu.cpp | 6 +++--- src/mir_app/src/meta_utils.cpp | 14 +++++++------- src/mir_app/src/profilemanager.cpp | 6 +++--- src/mir_app/src/proto_opts.cpp | 10 +++++----- src/mir_app/src/searchresults.cpp | 2 +- 12 files changed, 37 insertions(+), 37 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp index 9682a2fd59..3bd772ae77 100644 --- a/src/mir_app/src/FontOptions.cpp +++ b/src/mir_app/src/FontOptions.cpp @@ -158,7 +158,7 @@ static BOOL ExportSettings(HWND hwndDlg, const wchar_t *filename, OBJLISTgroupName+1); - if (MessageBox(g_clistApi.hwndContactList, szQuestion, TranslateT("Delete group"), MB_YESNO | MB_ICONQUESTION) == IDNO) + if (MessageBoxW(g_clistApi.hwndContactList, szQuestion, TranslateT("Delete group"), MB_YESNO | MB_ICONQUESTION) == IDNO) return 1; } @@ -326,7 +326,7 @@ MIR_APP_DLL(int) Clist_GroupMoveBefore(MGROUP hGroup, MGROUP hGroupBefore) static int RenameGroupWithMove(int groupId, const wchar_t *szName, int move) { if (GroupNameExists(szName, groupId)) { - MessageBox(nullptr, TranslateT("You already have a group with that name. Please enter a unique name for the group."), TranslateT("Rename group"), MB_ICONERROR | MB_OK); + MessageBoxW(nullptr, TranslateT("You already have a group with that name. Please enter a unique name for the group."), TranslateT("Rename group"), MB_ICONERROR | MB_OK); return 1; } diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 638b8ce713..633603f62e 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -200,7 +200,7 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam) if (status == ID_STATUS_OFFLINE || IsStatusConnecting(status)) { // Set a flag so we remember to delete the contact when the protocol goes online the next time db_set_b(wParam, "CList", "Delete", 1); - MessageBox(nullptr, + MessageBoxW(nullptr, TranslateT("This contact is on an instant messaging system which stores its contact list on a central server. The contact will be removed from the server and from your contact list when you next connect to that network."), TranslateT("Delete contact"), MB_ICONINFORMATION | MB_OK); return 0; diff --git a/src/mir_app/src/db_ini.cpp b/src/mir_app/src/db_ini.cpp index 88f151282c..910f0732f6 100644 --- a/src/mir_app/src/db_ini.cpp +++ b/src/mir_app/src/db_ini.cpp @@ -501,7 +501,7 @@ LBL_NewLine: default: wchar_t buf[250]; mir_snwprintf(buf, TranslateT("Invalid setting type for '%s'. The first character of every value must be b, w, d, l, s, e, u, g, h or n."), _A2T(szName).get()); - MessageBox(nullptr, buf, TranslateT("Install database settings"), MB_ICONWARNING | MB_OK); + MessageBoxW(nullptr, buf, TranslateT("Install database settings"), MB_ICONWARNING | MB_OK); break; } } diff --git a/src/mir_app/src/findadd.cpp b/src/mir_app/src/findadd.cpp index 2f1f9374d1..7ddb583339 100644 --- a/src/mir_app/src/findadd.cpp +++ b/src/mir_app/src/findadd.cpp @@ -689,7 +689,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP GetDlgItemText(hwndDlg, IDC_PROTOID, str, _countof(str)); rtrimw(str); if (str[0] == 0) - MessageBox(hwndDlg, sttErrMsg, sttErrTitle, MB_ICONERROR | MB_OK); + MessageBoxW(hwndDlg, sttErrMsg, sttErrTitle, MB_ICONERROR | MB_OK); else BeginSearch(hwndDlg, dat, szProto, PS_BASICSEARCH, PF1_BASICSEARCH, str); } @@ -698,7 +698,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP GetDlgItemText(hwndDlg, IDC_EMAIL, str, _countof(str)); rtrimw(str); if (str[0] == 0) - MessageBox(hwndDlg, sttErrMsg, sttErrTitle, MB_ICONERROR | MB_OK); + MessageBoxW(hwndDlg, sttErrMsg, sttErrTitle, MB_ICONERROR | MB_OK); else BeginSearch(hwndDlg, dat, szProto, PS_SEARCHBYEMAIL, PF1_SEARCHBYEMAIL, str); } @@ -712,13 +712,13 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP psbn.pszLastName = last; psbn.pszNick = nick; if (nick[0] == 0 && first[0] == 0 && last[0] == 0) - MessageBox(hwndDlg, sttErrMsg, sttErrTitle, MB_ICONERROR | MB_OK); + MessageBoxW(hwndDlg, sttErrMsg, sttErrTitle, MB_ICONERROR | MB_OK); else BeginSearch(hwndDlg, dat, szProto, PS_SEARCHBYNAME, PF1_SEARCHBYNAME, &psbn); } else if (IsDlgButtonChecked(hwndDlg, IDC_BYADVANCED)) { if (dat->hwndAdvSearch == nullptr) - MessageBox(hwndDlg, sttErrMsg, sttErrTitle, MB_ICONERROR | MB_OK); + MessageBoxW(hwndDlg, sttErrMsg, sttErrTitle, MB_ICONERROR | MB_OK); else BeginSearch(hwndDlg, dat, szProto, PS_SEARCHBYADVANCED, PF1_EXTSEARCHUI, dat->hwndAdvSearch); } diff --git a/src/mir_app/src/meta_addto.cpp b/src/mir_app/src/meta_addto.cpp index 95e84d2d19..7cf6b8d7ce 100644 --- a/src/mir_app/src/meta_addto.cpp +++ b/src/mir_app/src/meta_addto.cpp @@ -138,14 +138,14 @@ bool CMetaSelectDlg::OnInitDialog() return false; if (cc->IsMeta()) { - MessageBox(GetHwnd(), + MessageBoxW(GetHwnd(), TranslateT("This contact is a metacontact.\nYou can't add a metacontact to another metacontact.\n\nPlease choose another."), TranslateT("Metacontact conflict"), MB_ICONERROR); return false; } if (cc->IsSub()) { - MessageBox(GetHwnd(), + MessageBoxW(GetHwnd(), TranslateT("This contact is already associated to a metacontact.\nYou cannot add a contact to multiple metacontacts."), TranslateT("Multiple metacontacts"), MB_ICONERROR); return false; @@ -157,7 +157,7 @@ bool CMetaSelectDlg::OnInitDialog() CheckDlgButton(GetHwnd(), IDC_ONLYAVAIL, BST_CHECKED); // Initially checked; display all metacontacts is only an option // Besides, we can check if there is at least one metacontact to add the contact to. if (BuildList(GetDlgItem(GetHwnd(), IDC_METALIST), FALSE) <= 0) { - if (MessageBox(GetHwnd(), TranslateW(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES) + if (MessageBoxW(GetHwnd(), TranslateW(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES) Meta_Convert(m_hContact, 0); return false; } @@ -179,13 +179,13 @@ bool CMetaSelectDlg::OnApply() { int item = m_metaList.GetCurSel(); if (item == -1) { - BOOL result = IDOK == MessageBox(GetHwnd(), TranslateT("Please select a metacontact"), TranslateT("No metacontact selected"), MB_ICONHAND); + BOOL result = IDOK == MessageBoxW(GetHwnd(), TranslateT("Please select a metacontact"), TranslateT("No metacontact selected"), MB_ICONHAND); EndModal(result); } MCONTACT hMeta = (MCONTACT)m_metaList.GetItemData(item); if (!Meta_Assign(m_hContact, hMeta, false)) - MessageBox(GetHwnd(), TranslateT("Assignment to the metacontact failed."), TranslateT("Assignment failure"), MB_ICONERROR); + MessageBoxW(GetHwnd(), TranslateT("Assignment to the metacontact failed."), TranslateT("Assignment failure"), MB_ICONERROR); return true; } @@ -207,7 +207,7 @@ void CMetaSelectDlg::SortCheck_OnChange(CCtrlCheck*) { SetWindowLongPtr(m_metaList.GetHwnd(), GWL_STYLE, GetWindowLongPtr(m_metaList.GetHwnd(), GWL_STYLE) ^ LBS_SORT); if (BuildList(m_metaList.GetHwnd(), m_sortCheck.GetState() ? TRUE : FALSE) <= 0) { - if (MessageBox(GetHwnd(), TranslateW(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES) + if (MessageBoxW(GetHwnd(), TranslateW(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES) Meta_Convert(m_hContact, 0); Close(); } diff --git a/src/mir_app/src/meta_edit.cpp b/src/mir_app/src/meta_edit.cpp index 34e8dd6562..9f57a4131f 100644 --- a/src/mir_app/src/meta_edit.cpp +++ b/src/mir_app/src/meta_edit.cpp @@ -293,7 +293,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara switch (LOWORD(wParam)) { case IDC_VALIDATE: // Apply changes, if there is still one contact attached to the metacontact. if (g_data.num_contacts == 0) { // Otherwise, delete the metacontact. - if (IDYES == MessageBox(hwndDlg, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) { + if (IDYES == MessageBoxW(hwndDlg, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) { Meta_Delete(g_data.hMeta, 0); DestroyWindow(hwndDlg); } @@ -308,7 +308,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara case IDOK: if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_VALIDATE))) { // If there are changes that could be made, if (g_data.num_contacts == 0) { // do the work that would have be done if the 'Apply' button was clicked. - if (IDYES == MessageBox(hwndDlg, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) { + if (IDYES == MessageBoxW(hwndDlg, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) { Meta_Delete(g_data.hMeta, 0); DestroyWindow(hwndDlg); } diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp index a0562375db..7956574fd5 100644 --- a/src/mir_app/src/meta_menu.cpp +++ b/src/mir_app/src/meta_menu.cpp @@ -72,7 +72,7 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM) // Assign the contact to the MetaContact just created (and make default). if (!Meta_Assign(wParam, hMetaContact, true)) { - MessageBox(nullptr, TranslateT("There was a problem in assigning the contact to the metacontact"), TranslateT("Error"), MB_ICONEXCLAMATION); + MessageBoxW(nullptr, TranslateT("There was a problem in assigning the contact to the metacontact"), TranslateT("Error"), MB_ICONEXCLAMATION); db_delete_contact(hMetaContact); return 0; } @@ -189,7 +189,7 @@ INT_PTR Meta_Delete(WPARAM hContact, LPARAM bSkipQuestion) if (cc->IsMeta()) { // check from recursion - see second half of this function if (!bSkipQuestion && IDYES != - MessageBox(g_clistApi.hwndContactList, + MessageBoxW(g_clistApi.hwndContactList, TranslateT("This will remove the metacontact permanently.\n\nProceed anyway?"), TranslateT("Are you sure?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2)) return 0; @@ -205,7 +205,7 @@ INT_PTR Meta_Delete(WPARAM hContact, LPARAM bSkipQuestion) return 2; if (cc->nSubs == 1) { - if (IDYES == MessageBox(nullptr, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) + if (IDYES == MessageBoxW(nullptr, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) Meta_Delete(cc->contactID, 1); return 0; diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp index 3ded28f003..a6a36d435a 100644 --- a/src/mir_app/src/meta_utils.cpp +++ b/src/mir_app/src/meta_utils.cpp @@ -66,7 +66,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, bool set_as_default) char *szProto = Proto_GetBaseAccountName(hSub); if (szProto == nullptr) { - MessageBox(nullptr, TranslateT("Could not retrieve contact protocol"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING); + MessageBoxW(nullptr, TranslateT("Could not retrieve contact protocol"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING); return FALSE; } @@ -74,19 +74,19 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, bool set_as_default) const char *field = Proto_GetUniqueId(szProto); DBVARIANT dbv; if (db_get(hSub, szProto, field, &dbv)) { - MessageBox(nullptr, TranslateT("Could not get unique ID of contact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING); + MessageBoxW(nullptr, TranslateT("Could not get unique ID of contact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING); return FALSE; } // Check that is is 'on the list' if (!Contact_OnList(hSub)) { - MessageBox(nullptr, TranslateT("Contact is 'not on list' - please add the contact to your contact list before assigning."), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING); + MessageBoxW(nullptr, TranslateT("Contact is 'not on list' - please add the contact to your contact list before assigning."), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING); db_free(&dbv); return FALSE; } if (ccDest->nSubs >= MAX_CONTACTS) { - MessageBox(nullptr, TranslateT("Metacontact is full"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING); + MessageBoxW(nullptr, TranslateT("Metacontact is full"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING); db_free(&dbv); return FALSE; } @@ -95,7 +95,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, bool set_as_default) char buffer[512]; mir_snprintf(buffer, "Protocol%d", ccDest->nSubs); if (db_set_s(hMeta, META_PROTO, buffer, szProto)) { - MessageBox(nullptr, TranslateT("Could not write contact protocol to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING); + MessageBoxW(nullptr, TranslateT("Could not write contact protocol to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING); db_free(&dbv); return FALSE; } @@ -103,7 +103,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, bool set_as_default) // write the login mir_snprintf(buffer, "Login%d", ccDest->nSubs); if (db_set(hMeta, META_PROTO, buffer, &dbv)) { - MessageBox(nullptr, TranslateT("Could not write unique ID of contact to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING); + MessageBoxW(nullptr, TranslateT("Could not write unique ID of contact to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING); db_free(&dbv); return FALSE; } @@ -115,7 +115,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, bool set_as_default) // write the nickname mir_snprintf(buffer, "Nick%d", ccDest->nSubs); if (db_set(hMeta, META_PROTO, buffer, &dbv)) { - MessageBox(nullptr, TranslateT("Could not write nickname of contact to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING); + MessageBoxW(nullptr, TranslateT("Could not write nickname of contact to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING); db_free(&dbv); return FALSE; } diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp index 69cc0eff06..edbd7101cb 100644 --- a/src/mir_app/src/profilemanager.cpp +++ b/src/mir_app/src/profilemanager.cpp @@ -154,13 +154,13 @@ class CCreateProfileDlg : public CDlgBase mir_snwprintf(buf, TranslateT("The profile '%s' already exists. Do you want to move it to the Recycle Bin?\n\nWARNING: The profile will be deleted if Recycle Bin is disabled.\nWARNING: A profile may contain confidential information and should be properly deleted."), file); - if (MessageBox(m_hwnd, buf, TranslateT("The profile already exists"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2) != IDYES) + if (MessageBoxW(m_hwnd, buf, TranslateT("The profile already exists"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2) != IDYES) return 0; // move the file if (DeleteDirectoryTreeW(profile, true) != 0) { mir_snwprintf(buf, TranslateT("Couldn't move '%s' to the Recycle Bin. Please select another profile name."), file); - MessageBox(m_hwnd, buf, TranslateT("Problem moving profile"), MB_ICONINFORMATION | MB_OK); + MessageBoxW(m_hwnd, buf, TranslateT("Problem moving profile"), MB_ICONINFORMATION | MB_OK); return 0; } // now the file should be gone! @@ -169,7 +169,7 @@ class CCreateProfileDlg : public CDlgBase CreatePathToFileW(profile); if ((err = link->makeDatabase(profile)) != ERROR_SUCCESS) { mir_snwprintf(buf, TranslateT("Unable to create the profile '%s', the error was %x"), file, err); - MessageBox(m_hwnd, buf, TranslateT("Problem creating profile"), MB_ICONERROR | MB_OK); + MessageBoxW(m_hwnd, buf, TranslateT("Problem creating profile"), MB_ICONERROR | MB_OK); return 0; } diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp index 608afe11d0..545d2d6658 100644 --- a/src/mir_app/src/proto_opts.cpp +++ b/src/mir_app/src/proto_opts.cpp @@ -449,7 +449,7 @@ public: if (pa->iRealStatus >= ID_STATUS_ONLINE) { wchar_t buf[200]; mir_snwprintf(buf, TranslateT("Account %s is being disabled"), pa->tszAccountName); - if (IDNO == ::MessageBox(m_hwnd, TranslateT("Account is online. Disable account?"), buf, MB_ICONWARNING | MB_DEFBUTTON2 | MB_YESNO)) + if (IDNO == ::MessageBoxW(m_hwnd, TranslateT("Account is online. Disable account?"), buf, MB_ICONWARNING | MB_DEFBUTTON2 | MB_YESNO)) return; // stay enabled } @@ -529,11 +529,11 @@ public: wchar_t buf[200]; mir_snwprintf(buf, TranslateT("Account %s is being deleted"), pa->tszAccountName); if (pa->bOldProto) { - MessageBox(m_hwnd, TranslateT("You need to disable plugin to delete this account"), buf, MB_ICONERROR | MB_OK); + MessageBoxW(m_hwnd, TranslateT("You need to disable plugin to delete this account"), buf, MB_ICONERROR | MB_OK); return; } - if (IDYES != MessageBox(m_hwnd, errMsg, buf, MB_ICONWARNING | MB_DEFBUTTON2 | MB_YESNO)) + if (IDYES != MessageBoxW(m_hwnd, errMsg, buf, MB_ICONWARNING | MB_DEFBUTTON2 | MB_YESNO)) return; // lock controls to avoid changes during remove process @@ -859,7 +859,7 @@ bool CAccountFormDlg::OnApply() m_accName.GetText(tszAccName, _countof(tszAccName)); rtrimw(tszAccName); if (tszAccName[0] == 0) { - MessageBox(m_hwnd, TranslateT("Account name must be filled."), TranslateT("Account error"), MB_ICONERROR | MB_OK); + MessageBoxW(m_hwnd, TranslateT("Account name must be filled."), TranslateT("Account error"), MB_ICONERROR | MB_OK); return false; } @@ -867,7 +867,7 @@ bool CAccountFormDlg::OnApply() char buf[200]; m_internalName.GetTextA(buf, _countof(buf)); if (FindAccountByName(rtrim(buf))) { - MessageBox(m_hwnd, TranslateT("Account name has to be unique. Please enter unique name."), TranslateT("Account error"), MB_ICONERROR | MB_OK); + MessageBoxW(m_hwnd, TranslateT("Account name has to be unique. Please enter unique name."), TranslateT("Account error"), MB_ICONERROR | MB_OK); return false; } } diff --git a/src/mir_app/src/searchresults.cpp b/src/mir_app/src/searchresults.cpp index 3f2f06dd80..2c70bea508 100644 --- a/src/mir_app/src/searchresults.cpp +++ b/src/mir_app/src/searchresults.cpp @@ -182,7 +182,7 @@ static void __cdecl BeginSearchFailed(wchar_t *protoName) mir_free(protoName); } else buf = TranslateT("Could not search on any of the protocols, are you online?"); - MessageBox(nullptr, buf, TranslateT("Problem with search"), MB_OK | MB_ICONERROR); + MessageBoxW(nullptr, buf, TranslateT("Problem with search"), MB_OK | MB_ICONERROR); } int BeginSearch(HWND, struct FindAddDlgData *dat, const char *szProto, const char *szSearchService, uint32_t requiredCapability, void *pvSearchParams) -- cgit v1.2.3