Author: cwittich
Date: Tue Apr 14 08:04:18 2015
New Revision: 67191
URL:
http://svn.reactos.org/svn/reactos?rev=67191&view=rev
Log:
[CHARMAP]
use RegCreateKeyEx instead of RegCreateKey/RegOpenKeyEx
Modified:
trunk/reactos/base/applications/charmap/settings.c
Modified: trunk/reactos/base/applications/charmap/settings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/charmap/…
==============================================================================
--- trunk/reactos/base/applications/charmap/settings.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/charmap/settings.c [iso-8859-1] Tue Apr 14 08:04:18
2015
@@ -114,28 +114,24 @@
{
HKEY hKey = NULL;
- if (RegCreateKey(HKEY_CURRENT_USER, g_szGeneralRegKey, &hKey) == ERROR_SUCCESS)
+ if (RegCreateKeyEx(HKEY_CURRENT_USER, g_szGeneralRegKey, 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hKey, NULL) == ERROR_SUCCESS)
{
+ TCHAR szBuffer[MAX_PATH];
+
+ hWnd = GetDlgItem(hCharmapDlg, IDC_FONTCOMBO);
+ ComboBox_GetText(hWnd, szBuffer, MAX_PATH);
+
+ if(*szBuffer != '\0')
+ RegSetValueEx(hKey, _T("Font"), 0, REG_SZ, (LPBYTE) szBuffer,
(DWORD) MAX_PATH);
+
+ hWnd = GetDlgItem(hCharmapDlg, IDC_COMBO_CHARSET);
+ ComboBox_GetText(hWnd, szBuffer, MAX_PATH);
+
+ if(*szBuffer != '\0')
+ RegSetValueEx(hKey, _T("CodePage"), 0, REG_SZ, (LPBYTE) szBuffer,
(DWORD) MAX_PATH);
+
+ RegSetValueEx(hKey, _T("Advanced"), 0, REG_DWORD,
(LPBYTE)&Settings.IsAdvancedView, (DWORD) sizeof(DWORD));
+
RegCloseKey(hKey);
- if (RegOpenKeyEx(HKEY_CURRENT_USER, g_szGeneralRegKey, 0, KEY_SET_VALUE,
&hKey) == ERROR_SUCCESS)
- {
- TCHAR szBuffer[MAX_PATH];
-
- hWnd = GetDlgItem(hCharmapDlg, IDC_FONTCOMBO);
- ComboBox_GetText(hWnd, szBuffer, MAX_PATH);
-
- if(*szBuffer != '\0')
- RegSetValueEx(hKey, _T("Font"), 0, REG_SZ, (LPBYTE) szBuffer,
(DWORD) MAX_PATH);
-
- hWnd = GetDlgItem(hCharmapDlg, IDC_COMBO_CHARSET);
- ComboBox_GetText(hWnd, szBuffer, MAX_PATH);
-
- if(*szBuffer != '\0')
- RegSetValueEx(hKey, _T("CodePage"), 0, REG_SZ, (LPBYTE)
szBuffer, (DWORD) MAX_PATH);
-
- RegSetValueEx(hKey, _T("Advanced"), 0, REG_DWORD,
(LPBYTE)&Settings.IsAdvancedView, (DWORD) sizeof(DWORD));
-
- RegCloseKey(hKey);
- }
}
}