@@ -97,7 +97,6 @@ gup -unzipTo [-clean] FOLDER_TO_ACTION ZIP_URL\r\
9797 ZIP_URL: The URL to download zip file.\r \
9898 FOLDER_TO_ACTION: The folder where we clean or/and unzip to.\r \
9999 " ;
100- std::wstring thirdDoUpdateDlgButtonLabel;
101100
102101class DlgIconHelper
103102{
@@ -608,19 +607,39 @@ LRESULT CALLBACK progressBarDlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARA
608607 return FALSE ;
609608}
610609
610+ struct UpdateAvailableDlgStrings
611+ {
612+ wstring _title;
613+ wstring _message;
614+ wstring _customButton;
615+ wstring _yesButton;
616+ wstring _yesSilentButton;
617+ wstring _noButton;
618+ };
611619
612620LRESULT CALLBACK yesNoNeverDlgProc (HWND hWndDlg, UINT message, WPARAM wParam, LPARAM lParam)
613621{
614622 switch (message)
615623 {
616624 case WM_INITDIALOG:
617625 {
618- if (thirdDoUpdateDlgButtonLabel != L" " )
619- ::SetDlgItemText (hWndDlg, IDCANCEL, thirdDoUpdateDlgButtonLabel.c_str());
620-
621626 if (lParam)
622627 {
623- ::SetDlgItemText (hWndDlg, IDC_YESNONEVERMSG, (LPCWSTR)lParam);
628+ UpdateAvailableDlgStrings* pUaDlgStrs = reinterpret_cast <UpdateAvailableDlgStrings*>(lParam);
629+
630+ if (!(pUaDlgStrs->_message ).empty ())
631+ ::SetDlgItemText (hWndDlg, IDC_YESNONEVERMSG, pUaDlgStrs->_message.c_str());
632+ if (!(pUaDlgStrs->_title ).empty ())
633+ ::SetWindowText (hWndDlg, pUaDlgStrs->_title.c_str());
634+
635+ if (!pUaDlgStrs->_customButton .empty ())
636+ ::SetDlgItemText (hWndDlg, IDCANCEL, pUaDlgStrs->_customButton.c_str());
637+ if (!pUaDlgStrs->_yesButton .empty ())
638+ ::SetDlgItemText (hWndDlg, IDYES, pUaDlgStrs->_yesButton.c_str());
639+ if (!pUaDlgStrs->_yesSilentButton .empty ())
640+ ::SetDlgItemText (hWndDlg, IDOK, pUaDlgStrs->_yesSilentButton.c_str());
641+ if (!pUaDlgStrs->_noButton .empty ())
642+ ::SetDlgItemText (hWndDlg, IDNO, pUaDlgStrs->_noButton.c_str());
624643 }
625644
626645 goToScreenCenter (hWndDlg);
@@ -1380,7 +1399,12 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR lpszCmdLine, int)
13801399 // Process Update Info
13811400 //
13821401
1383- // Ask user if he/she want to do update
1402+ // Ask if user wants to do update
1403+
1404+ UpdateAvailableDlgStrings uaDlgStrs;
1405+ uaDlgStrs._title = nativeLang.getMessageString (" MSGID_UPDATETITLE" );
1406+
1407+
13841408 wstring updateAvailable = nativeLang.getMessageString (" MSGID_UPDATEAVAILABLE" );
13851409 if (updateAvailable.empty ())
13861410 updateAvailable = MSGID_UPDATEAVAILABLE;
@@ -1398,10 +1422,15 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR lpszCmdLine, int)
13981422 updateAvailable += L" \n\n " + versionCurrent;
13991423 updateAvailable += L" \n " + versionNew;
14001424
1401- thirdDoUpdateDlgButtonLabel = gupParams.get3rdButtonLabel ();
1425+ uaDlgStrs._message = updateAvailable;
1426+
1427+ uaDlgStrs._customButton = nativeLang.getMessageString (" MSGID_UPDATENEVER" );
1428+ uaDlgStrs._yesButton = nativeLang.getMessageString (" MSGID_UPDATEYES" );
1429+ uaDlgStrs._yesSilentButton = nativeLang.getMessageString (" MSGID_UPDATEYESSILENT" );
1430+ uaDlgStrs._noButton = nativeLang.getMessageString (" MSGID_UPDATENo" );
14021431
14031432 int dlAnswer = 0 ;
1404- dlAnswer = static_cast <int32_t >(::DialogBoxParam (hInst, MAKEINTRESOURCE (IDD_YESNONEVERDLG), hApp, reinterpret_cast <DLGPROC>(yesNoNeverDlgProc), (LPARAM)updateAvailable. c_str () ));
1433+ dlAnswer = static_cast <int32_t >(::DialogBoxParam (hInst, MAKEINTRESOURCE (IDD_YESNONEVERDLG), hApp, reinterpret_cast <DLGPROC>(yesNoNeverDlgProc), (LPARAM)&uaDlgStrs ));
14051434
14061435 if (dlAnswer == IDNO)
14071436 {
0 commit comments