diff --git a/programs/winemine/dialog.c b/programs/winemine/dialog.c index b7acda3fa7..8739cd7ff7 100644 --- a/programs/winemine/dialog.c +++ b/programs/winemine/dialog.c @@ -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; } - diff --git a/programs/winemine/main.c b/programs/winemine/main.c index 38f26a6b3d..7db26b7cb5 100644 --- a/programs/winemine/main.c +++ b/programs/winemine/main.c @@ -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; } }