From 640fb7d2220b6493782c25f70eac4ee561c5e214 Mon Sep 17 00:00:00 2001 From: Gregor Schneider Date: Wed, 14 Apr 2010 19:08:27 +0000 Subject: [PATCH] [DESK] - Create a function for updating the currently selected theme id - Call this function before saving theme data to the registry, fixes saving invalid theme indexes - Remove unnecessary header tags See issue #5016 for more details. svn path=/trunk/; revision=46870 --- reactos/dll/cpl/desk/appearance.c | 15 ++++++++++----- reactos/dll/cpl/desk/effappdlg.c | 3 +-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/reactos/dll/cpl/desk/appearance.c b/reactos/dll/cpl/desk/appearance.c index 9a09169283b..c3c21d4cd13 100644 --- a/reactos/dll/cpl/desk/appearance.c +++ b/reactos/dll/cpl/desk/appearance.c @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS Display Control Panel * FILE: lib/cpl/desk/appearance.c @@ -486,11 +485,17 @@ AppearancePage_OnDestroy(HWND hwndDlg, GLOBALS *g) return TRUE; } +static void +UpdateSelectedThemeId(HWND hwndDlg, GLOBALS *g) +{ + int sel; + sel = SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_COLORSCHEME, CB_GETCURSEL, 0, 0); + g->Theme.Id = SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_COLORSCHEME, CB_GETITEMDATA, (WPARAM)sel, 0); +} INT_PTR CALLBACK AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - INT i; GLOBALS *g; LPNMHDR lpnm; @@ -538,8 +543,7 @@ AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { PropSheet_Changed(GetParent(hwndDlg), hwndDlg); g->Theme.bHasChanged = TRUE; - i = SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_COLORSCHEME, CB_GETCURSEL, 0, 0); - g->Theme.Id = SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_COLORSCHEME, CB_GETITEMDATA, (WPARAM)i, 0); + UpdateSelectedThemeId(hwndDlg, g); LoadThemeFromReg(g); //SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, WM_PAINT, 0, 0); } @@ -557,6 +561,7 @@ AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) case PSN_APPLY: if (g->Theme.bHasChanged) { + UpdateSelectedThemeId(hwndDlg, g); ApplyTheme(g); } return TRUE; diff --git a/reactos/dll/cpl/desk/effappdlg.c b/reactos/dll/cpl/desk/effappdlg.c index 6fd0ac7ba8d..3a7c8b4e0e3 100644 --- a/reactos/dll/cpl/desk/effappdlg.c +++ b/reactos/dll/cpl/desk/effappdlg.c @@ -1,5 +1,4 @@ -/* $Id: effappdlg.c 24836 2007-02-12 03:12:56Z tkreuzer $ - * +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS Display Control Panel * FILE: dll/cpl/desk/effappdlg.c