@@ -591,7 +591,7 @@ LRESULT CALLBACK progressBarDlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARA
591591}
592592
593593
594- LRESULT CALLBACK yesNoNeverDlgProc (HWND hWndDlg, UINT message, WPARAM wParam, LPARAM)
594+ LRESULT CALLBACK yesNoNeverDlgProc (HWND hWndDlg, UINT message, WPARAM wParam, LPARAM lParam )
595595{
596596 switch (message)
597597 {
@@ -600,6 +600,11 @@ LRESULT CALLBACK yesNoNeverDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP
600600 if (thirdDoUpdateDlgButtonLabel != L" " )
601601 ::SetDlgItemText (hWndDlg, IDCANCEL, thirdDoUpdateDlgButtonLabel.c_str());
602602
603+ if (lParam)
604+ {
605+ ::SetDlgItemText (hWndDlg, IDC_YESNONEVERMSG, (LPCWSTR)lParam);
606+ }
607+
603608 goToScreenCenter (hWndDlg);
604609 return TRUE ;
605610 }
@@ -1063,13 +1068,16 @@ std::wstring productVersionToFileVersion(const std::wstring& productVersion)
10631068 return fileVersion;
10641069}
10651070
1066-
10671071#ifdef _DEBUG
10681072#define WRITE_LOG (fn, suffix, log ) writeLog(fn, suffix, log);
10691073#else
10701074#define WRITE_LOG (fn, suffix, log )
10711075#endif
10721076
1077+ // Definition from Notepad++
1078+ #define NPPMSG (WM_USER + 1000 )
1079+ #define NPPM_DISABLEAUTOUPDATE (NPPMSG + 95 ) // 2119 in decimal
1080+
10731081int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE, PWSTR lpszCmdLine, int )
10741082{
10751083 /*
@@ -1368,15 +1376,10 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR lpszCmdLine, int)
13681376 updateAvailable += L" \n\n " + versionCurrent;
13691377 updateAvailable += L" \n " + versionNew;
13701378
1371- int thirdButtonCmd = gupParams.get3rdButtonCmd ();
13721379 thirdDoUpdateDlgButtonLabel = gupParams.get3rdButtonLabel ();
13731380
13741381 int dlAnswer = 0 ;
1375-
1376- if (!thirdButtonCmd)
1377- dlAnswer = ::MessageBox (isModal ? hApp : NULL , updateAvailable.c_str (), gupParams.getMessageBoxTitle ().c_str (), MB_YESNO);
1378- else
1379- dlAnswer = static_cast <int32_t >(::DialogBox (hInst, MAKEINTRESOURCE (IDD_YESNONEVERDLG), isModal ? hApp : NULL , reinterpret_cast <DLGPROC>(yesNoNeverDlgProc)));
1382+ dlAnswer = static_cast <int32_t >(::DialogBoxParam (hInst, MAKEINTRESOURCE (IDD_YESNONEVERDLG), hApp, reinterpret_cast <DLGPROC>(yesNoNeverDlgProc), (LPARAM)updateAvailable.c_str ()));
13801383
13811384 if (dlAnswer == IDNO)
13821385 {
@@ -1385,12 +1388,9 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR lpszCmdLine, int)
13851388
13861389 if (dlAnswer == IDCANCEL)
13871390 {
1388- if (gupParams. getClassName () != L" " )
1391+ if (hApp )
13891392 {
1390- if (hApp)
1391- {
1392- ::SendMessage (hApp, thirdButtonCmd, gupParams.get3rdButtonWparam(), gupParams.get3rdButtonLparam());
1393- }
1393+ ::SendMessage (hApp, NPPM_DISABLEAUTOUPDATE, 0 , 0 );
13941394 }
13951395 return 0 ;
13961396 }
0 commit comments