@@ -48,7 +48,7 @@ INT_PTR CALLBACK DlgProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
4848 break ;
4949 case WM_CLOSE:
5050 {
51- EndDialog (hwnd, 0 );
51+ EndDialog (hwnd, IDCANCEL );
5252 }
5353 break ;
5454 case WM_COMMAND:
@@ -61,10 +61,10 @@ INT_PTR CALLBACK DlgProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
6161 WORD commandId = LOWORD (wParam);
6262 if (commandId == OkButtonId) {
6363 if (paramDialog->CollectChangedValues (hwnd)) {
64- EndDialog (hwnd, 1 );
64+ EndDialog (hwnd, IDOK );
6565 }
6666 } else if (commandId == CancelButtonId) {
67- EndDialog (hwnd, 0 );
67+ EndDialog (hwnd, IDCANCEL );
6868 } else {
6969 WORD notificationCode = HIWORD (wParam);
7070 switch (notificationCode) {
@@ -169,7 +169,8 @@ bool ParameterDialog::Show (HWND parentHwnd, short x, short y)
169169
170170 DialogParameters parameters (NE::LocalizeString (L" Parameters" ), x, y, dialogWidth, dialogHeight);
171171 parentWindowHandle = parentHwnd;
172- if (paramDialog.Show (parameters, parentHwnd, DlgProc, (LPARAM) this ) == 1 ) {
172+ INT_PTR dialogResult = paramDialog.Show (parameters, parentHwnd, DlgProc, (LPARAM) this );
173+ if (dialogResult == IDOK) {
173174 ApplyParameterChanges ();
174175 return true ;
175176 }
0 commit comments