winemine: Save board without need to correctly finish the app.

Thus player will never lose his best time even if app crashes.

Signed-off-by: Andrey Semakin <and-semakin@ya.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Andrey Semakin 2017-11-06 14:23:19 +05:00 committed by Alexandre Julliard
parent dc3293612d
commit 1392ab1112
1 changed files with 3 additions and 0 deletions

View File

@ -178,6 +178,8 @@ static void SaveBoard( BOARD *p_board )
RegSetValueExW( hkey, key_name, 0, REG_DWORD, (LPBYTE) &p_board->best_time[i], sizeof(p_board->best_time[i]) );
}
RegCloseKey( hkey );
WINE_TRACE("Board has been saved.\n");
}
static void DestroyBoard( BOARD *p_board )
@ -823,6 +825,7 @@ static void TestBoard( HWND hWnd, BOARD *p_board, int x, int y, int msg )
DialogBoxParamW( p_board->hInst, MAKEINTRESOURCEW(DLG_CONGRATS), hWnd,
CongratsDlgProc, (LPARAM) p_board);
SaveBoard( p_board );
DialogBoxParamW( p_board->hInst, MAKEINTRESOURCEW(DLG_TIMES), hWnd,
TimesDlgProc, (LPARAM) p_board);
}