regedit: Some minor unicode conversions.

This commit is contained in:
Alexander Nicolaysen Sørnes 2008-09-02 19:26:44 +02:00 committed by Alexandre Julliard
parent 7bb5df75d3
commit d67986b9dd
4 changed files with 18 additions and 16 deletions

View File

@ -379,7 +379,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
if (((int)wParam == LIST_WINDOW) && (g_pChildWnd != NULL)) { if (((int)wParam == LIST_WINDOW) && (g_pChildWnd != NULL)) {
if (((LPNMHDR)lParam)->code == NM_SETFOCUS) { if (((LPNMHDR)lParam)->code == NM_SETFOCUS) {
g_pChildWnd->nFocusPanel = 1; g_pChildWnd->nFocusPanel = 1;
} else if (!SendMessage(g_pChildWnd->hListWnd, WM_NOTIFY_REFLECT, wParam, lParam)) { } else if (!SendMessageW(g_pChildWnd->hListWnd, WM_NOTIFY_REFLECT, wParam, lParam)) {
goto def; goto def;
} }
} }

View File

@ -87,17 +87,19 @@ void error(HWND hwnd, INT resId, ...)
static void error_code_messagebox(HWND hwnd, DWORD error_code) static void error_code_messagebox(HWND hwnd, DWORD error_code)
{ {
LPTSTR lpMsgBuf; LPWSTR lpMsgBuf;
DWORD status; DWORD status;
TCHAR title[256]; WCHAR title[256];
static TCHAR fallback[] = TEXT("Error displaying error message.\n"); static WCHAR fallback[] = {'E','r','r','o','r',' ','d','i','s','p','l','a','y','i','n','g',' ','e','r','r','o','r',' ','m','e','s','s','a','g','e','.','\n',0};
if (!LoadString(hInst, IDS_ERROR, title, COUNT_OF(title))) static const WCHAR title_error[] = {'E','r','r','o','r',0};
lstrcpy(title, TEXT("Error"));
status = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, if (!LoadStringW(hInst, IDS_ERROR, title, COUNT_OF(title)))
NULL, error_code, 0, (LPTSTR)&lpMsgBuf, 0, NULL); lstrcpyW(title, title_error);
status = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, error_code, 0, (LPWSTR)&lpMsgBuf, 0, NULL);
if (!status) if (!status)
lpMsgBuf = fallback; lpMsgBuf = fallback;
MessageBox(hwnd, lpMsgBuf, title, MB_OK | MB_ICONERROR); MessageBoxW(hwnd, lpMsgBuf, title, MB_OK | MB_ICONERROR);
if (lpMsgBuf != fallback) if (lpMsgBuf != fallback)
LocalFree(lpMsgBuf); LocalFree(lpMsgBuf);
} }

View File

@ -56,7 +56,7 @@ static void resize_frame_rect(HWND hWnd, PRECT prect)
RECT rt; RECT rt;
/* /*
if (IsWindowVisible(hToolBar)) { if (IsWindowVisible(hToolBar)) {
SendMessage(hToolBar, WM_SIZE, 0, 0); SendMessageW(hToolBar, WM_SIZE, 0, 0);
GetClientRect(hToolBar, &rt); GetClientRect(hToolBar, &rt);
prect->top = rt.bottom+3; prect->top = rt.bottom+3;
prect->bottom -= rt.bottom+3; prect->bottom -= rt.bottom+3;
@ -607,8 +607,8 @@ static INT_PTR CALLBACK removefavorite_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM w
} }
break; break;
case IDOK: { case IDOK: {
int pos = SendMessage(hwndList, LB_GETCURSEL, 0, 0); int pos = SendMessageW(hwndList, LB_GETCURSEL, 0, 0);
int len = SendMessage(hwndList, LB_GETTEXTLEN, pos, 0); int len = SendMessageW(hwndList, LB_GETTEXTLEN, pos, 0);
if (len>0) { if (len>0) {
LPWSTR lpName = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*(len+1)); LPWSTR lpName = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*(len+1));
SendMessageW(hwndList, LB_GETTEXT, pos, (LPARAM)lpName); SendMessageW(hwndList, LB_GETTEXT, pos, (LPARAM)lpName);
@ -739,7 +739,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
hItem = FindNext(g_pChildWnd->hTreeWnd, hItem, searchString, searchMask, &row); hItem = FindNext(g_pChildWnd->hTreeWnd, hItem, searchString, searchMask, &row);
SetCursor(hcursorOld); SetCursor(hcursorOld);
if (hItem) { if (hItem) {
SendMessage( g_pChildWnd->hTreeWnd, TVM_SELECTITEM, TVGN_CARET, (LPARAM) hItem ); SendMessageW( g_pChildWnd->hTreeWnd, TVM_SELECTITEM, TVGN_CARET, (LPARAM) hItem );
InvalidateRect(g_pChildWnd->hTreeWnd, NULL, TRUE); InvalidateRect(g_pChildWnd->hTreeWnd, NULL, TRUE);
UpdateWindow(g_pChildWnd->hTreeWnd); UpdateWindow(g_pChildWnd->hTreeWnd);
if (row != -1) { if (row != -1) {
@ -886,7 +886,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if(ClientToScreen(g_pChildWnd->hWnd, &pts)) { if(ClientToScreen(g_pChildWnd->hWnd, &pts)) {
SetCursorPos(pts.x, pts.y); SetCursorPos(pts.x, pts.y);
SetCursor(LoadCursor(0, IDC_SIZEWE)); SetCursor(LoadCursor(0, IDC_SIZEWE));
SendMessage(g_pChildWnd->hWnd, WM_LBUTTONDOWN, 0, MAKELPARAM(pt.x, pt.y)); SendMessageW(g_pChildWnd->hWnd, WM_LBUTTONDOWN, 0, MAKELPARAM(pt.x, pt.y));
} }
return TRUE; return TRUE;
} }

View File

@ -411,7 +411,7 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
case NM_RETURN: { case NM_RETURN: {
int cnt = ListView_GetNextItem(hWnd, -1, LVNI_FOCUSED | LVNI_SELECTED); int cnt = ListView_GetNextItem(hWnd, -1, LVNI_FOCUSED | LVNI_SELECTED);
if (cnt != -1) if (cnt != -1)
SendMessage(hFrameWnd, WM_COMMAND, ID_EDIT_MODIFY, 0); SendMessageW(hFrameWnd, WM_COMMAND, ID_EDIT_MODIFY, 0);
} }
break; break;
case NM_DBLCLK: { case NM_DBLCLK: {
@ -439,7 +439,7 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
ListView_SetItemState(hWnd, -1, 0, LVIS_FOCUSED|LVIS_SELECTED); ListView_SetItemState(hWnd, -1, 0, LVIS_FOCUSED|LVIS_SELECTED);
ListView_SetItemState(hWnd, info.iItem, LVIS_FOCUSED|LVIS_SELECTED, ListView_SetItemState(hWnd, info.iItem, LVIS_FOCUSED|LVIS_SELECTED,
LVIS_FOCUSED|LVIS_SELECTED); LVIS_FOCUSED|LVIS_SELECTED);
SendMessage(hFrameWnd, WM_COMMAND, ID_EDIT_MODIFY, 0); SendMessageW(hFrameWnd, WM_COMMAND, ID_EDIT_MODIFY, 0);
} }
} }
break; break;