Fixed handling of control focus.
diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c index b76526b..bb031f6 100644 --- a/programs/regedit/childwnd.c +++ b/programs/regedit/childwnd.c
@@ -126,6 +126,7 @@ pChildWnd->hWnd = hWnd; pChildWnd->hTreeWnd = CreateTreeView(hWnd, pChildWnd->szPath, TREE_WINDOW); pChildWnd->hListWnd = CreateListView(hWnd, LIST_WINDOW/*, pChildWnd->szPath*/); + SetFocus(pChildWnd->hTreeWnd); break; case WM_COMMAND: if (!_CmdWndProc(hWnd, message, wParam, lParam)) { @@ -243,12 +244,17 @@ } } break; + case NM_SETFOCUS: + pChildWnd->nFocusPanel = 1; + break; default: goto def; } } else if ((int)wParam == LIST_WINDOW) { - if (!SendMessage(pChildWnd->hListWnd, message, wParam, lParam)) { + if (((LPNMHDR)lParam)->code == NM_SETFOCUS) { + pChildWnd->nFocusPanel = 0; + } else if (!SendMessage(pChildWnd->hListWnd, message, wParam, lParam)) { goto def; } }
diff --git a/programs/regedit/listview.c b/programs/regedit/listview.c index bb75321..1a2d3b6 100644 --- a/programs/regedit/listview.c +++ b/programs/regedit/listview.c
@@ -375,7 +375,7 @@ /* Get the dimensions of the parent window's client area, and create the list view control. */ GetClientRect(hwndParent, &rcClient); hwndLV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, _T("List View"), - WS_VISIBLE | WS_CHILD | LVS_REPORT | LVS_EDITLABELS, + WS_VISIBLE | WS_CHILD | WS_TABSTOP | LVS_REPORT | LVS_EDITLABELS, 0, 0, rcClient.right, rcClient.bottom, hwndParent, (HMENU)id, hInst, NULL); if (!hwndLV) return NULL;
diff --git a/programs/regedit/main.c b/programs/regedit/main.c index 8dbaba9..4f2f5db 100644 --- a/programs/regedit/main.c +++ b/programs/regedit/main.c
@@ -186,7 +186,8 @@ /* Main message loop */ while (GetMessage(&msg, (HWND)NULL, 0, 0)) { - if (!TranslateAccelerator(msg.hwnd, hAccel, &msg)) { + if (!TranslateAccelerator(msg.hwnd, hAccel, &msg) && + !IsDialogMessage(hFrameWnd, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); }