Commit 4be4b19e authored by Alexandre Julliard's avatar Alexandre Julliard

regedit: Convert error box display to Unicode.

parent 259e8f61
...@@ -49,19 +49,19 @@ struct edit_params ...@@ -49,19 +49,19 @@ struct edit_params
static INT vmessagebox(HWND hwnd, INT buttons, INT titleId, INT resId, va_list ap) static INT vmessagebox(HWND hwnd, INT buttons, INT titleId, INT resId, va_list ap)
{ {
TCHAR title[256]; static const WCHAR errorW[] = {'E','r','r','o','r',0};
TCHAR errfmt[1024]; static const WCHAR unknownW[] = {'U','n','k','n','o','w','n',' ','e','r','r','o','r',' ','s','t','r','i','n','g','!',0};
TCHAR errstr[1024];
if (!LoadString(hInst, titleId, title, COUNT_OF(title))) WCHAR title[256];
lstrcpy(title, "Error"); WCHAR errfmt[1024];
WCHAR errstr[1024];
if (!LoadString(hInst, resId, errfmt, COUNT_OF(errfmt))) if (!LoadStringW(hInst, titleId, title, COUNT_OF(title))) lstrcpyW(title, errorW);
lstrcpy(errfmt, "Unknown error string!"); if (!LoadStringW(hInst, resId, errfmt, COUNT_OF(errfmt))) lstrcpyW(errfmt, unknownW);
_vsntprintf(errstr, COUNT_OF(errstr), errfmt, ap); vsnprintfW(errstr, COUNT_OF(errstr), errfmt, ap);
return MessageBox(hwnd, errstr, title, buttons); return MessageBoxW(hwnd, errstr, title, buttons);
} }
static INT messagebox(HWND hwnd, INT buttons, INT titleId, INT resId, ...) static INT messagebox(HWND hwnd, INT buttons, INT titleId, INT resId, ...)
...@@ -401,7 +401,6 @@ BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath) ...@@ -401,7 +401,6 @@ BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath)
BOOL result = FALSE; BOOL result = FALSE;
LONG lRet; LONG lRet;
HKEY hKey; HKEY hKey;
CHAR* keyPathA = GetMultiByteString(keyPath);
lRet = RegOpenKeyExW(hKeyRoot, keyPath, 0, KEY_READ|KEY_SET_VALUE, &hKey); lRet = RegOpenKeyExW(hKeyRoot, keyPath, 0, KEY_READ|KEY_SET_VALUE, &hKey);
if (lRet != ERROR_SUCCESS) { if (lRet != ERROR_SUCCESS) {
...@@ -409,7 +408,7 @@ BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath) ...@@ -409,7 +408,7 @@ BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath)
return FALSE; return FALSE;
} }
if (messagebox(hwnd, MB_YESNO | MB_ICONEXCLAMATION, IDS_DELETE_BOX_TITLE, IDS_DELETE_BOX_TEXT, keyPathA) != IDYES) if (messagebox(hwnd, MB_YESNO | MB_ICONEXCLAMATION, IDS_DELETE_BOX_TITLE, IDS_DELETE_BOX_TEXT, keyPath) != IDYES)
goto done; goto done;
lRet = SHDeleteKeyW(hKeyRoot, keyPath); lRet = SHDeleteKeyW(hKeyRoot, keyPath);
...@@ -421,7 +420,6 @@ BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath) ...@@ -421,7 +420,6 @@ BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath)
done: done:
RegCloseKey(hKey); RegCloseKey(hKey);
HeapFree(GetProcessHeap(), 0, keyPathA);
return result; return result;
} }
......
...@@ -757,9 +757,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) ...@@ -757,9 +757,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
SetFocus(g_pChildWnd->hTreeWnd); SetFocus(g_pChildWnd->hTreeWnd);
} }
} else { } else {
CHAR* searchStringA = GetMultiByteString(searchString); error(hWnd, IDS_NOTFOUND, searchString);
error(hWnd, IDS_NOTFOUND, searchStringA);
HeapFree(GetProcessHeap(), 0, searchStringA);
} }
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment