Commit 50a4503c authored by Pavel Roskin's avatar Pavel Roskin Committed by Alexandre Julliard

Fix processing of IDCANCEL command.

Don't change settings if the user canceled the "Custom" dialog.
parent 803d9a89
......@@ -47,7 +47,7 @@ BOOL CALLBACK CustomDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
return TRUE;
case IDCANCEL:
EndDialog( hDlg, 0 );
EndDialog( hDlg, 1 );
return TRUE;
}
break;
......@@ -105,6 +105,7 @@ BOOL CALLBACK TimesDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
case WM_COMMAND:
switch( LOWORD( wParam ) ) {
case IDOK:
case IDCANCEL:
EndDialog( hDlg, 0 );
return TRUE;
}
......@@ -122,6 +123,7 @@ BOOL CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
case WM_COMMAND:
switch( LOWORD( wParam ) ) {
case IDOK:
case IDCANCEL:
EndDialog( hDlg, 0 );
return TRUE;
}
......@@ -129,4 +131,3 @@ BOOL CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
}
return FALSE;
}
......@@ -441,8 +441,14 @@ void DestroyBoard( BOARD *p_board )
void SetDifficulty( BOARD *p_board, DIFFICULTY difficulty )
{
HMENU hMenu = GetMenu( p_board->hWnd );
HMENU hMenu;
if ( difficulty == CUSTOM )
if (DialogBoxParam( p_board->hInst, "DLG_CUSTOM", p_board->hWnd,
CustomDlgProc, (LPARAM) p_board) != 0)
return;
hMenu = GetMenu( p_board->hWnd );
CheckMenuItem( hMenu, IDM_BEGINNER + p_board->difficulty, MF_UNCHECKED );
p_board->difficulty = difficulty;
CheckMenuItem( hMenu, IDM_BEGINNER + difficulty, MF_CHECKED );
......@@ -467,8 +473,6 @@ void SetDifficulty( BOARD *p_board, DIFFICULTY difficulty )
break;
case CUSTOM:
DialogBoxParam( p_board->hInst, "DLG_CUSTOM", p_board->hWnd,
CustomDlgProc, (LPARAM) p_board);
break;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment