From f2e37886f7ca6d4ae67f2cc4a13935fed991d3f5 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Thu, 26 Apr 2007 15:42:12 +0000 Subject: [PATCH] Add a new cursor scheme to the scheme list and select it after it has been saved. svn path=/trunk/; revision=26524 --- reactos/dll/cpl/main/mouse.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/reactos/dll/cpl/main/mouse.c b/reactos/dll/cpl/main/mouse.c index 995e796df75..bd964f61448 100644 --- a/reactos/dll/cpl/main/mouse.c +++ b/reactos/dll/cpl/main/mouse.c @@ -27,7 +27,6 @@ //TODO: // add missing icons -// Options- pointer precision #define WINVER 0x0501 @@ -690,7 +689,7 @@ SaveCursorScheme(HWND hwndDlg) LPTSTR lpSchemeData; HKEY hCuKey; HKEY hCuCursorKey; - LONG lResult = ERROR_SUCCESS; + LONG lError = ERROR_SUCCESS; BOOL bSchemeExists; LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH); @@ -775,15 +774,25 @@ SaveCursorScheme(HWND hwndDlg) return FALSE; } - lResult = RegSetValueEx(hCuCursorKey, szNewSchemeName, 0, REG_EXPAND_SZ, - (LPBYTE)lpSchemeData, nLength * sizeof(TCHAR)); + lError = RegSetValueEx(hCuCursorKey, szNewSchemeName, 0, REG_EXPAND_SZ, + (LPBYTE)lpSchemeData, nLength * sizeof(TCHAR)); RegCloseKey(hCuCursorKey); RegCloseKey(hCuKey); + /* Add the new scheme to the scheme list and select it */ + if (lError == ERROR_SUCCESS) + { + LPTSTR copy = _tcsdup(lpSchemeData); + + nSel = SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_ADDSTRING, (WPARAM)0, (LPARAM)szNewSchemeName); + SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_SETITEMDATA, (WPARAM)nSel, (LPARAM)copy); + SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_SETCURSEL, (WPARAM)nSel, (LPARAM)0); + } + HeapFree(GetProcessHeap(), 0, lpSchemeData); - return (lResult == ERROR_SUCCESS); + return (lError == ERROR_SUCCESS); }