diff --git a/reactos/subsys/system/regedit/childwnd.c b/reactos/subsys/system/regedit/childwnd.c index ffc2f9de5c0..74a2ec1e125 100644 --- a/reactos/subsys/system/regedit/childwnd.c +++ b/reactos/subsys/system/regedit/childwnd.c @@ -141,6 +141,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa 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)) { @@ -284,6 +285,9 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa } } break; + case NM_SETFOCUS: + pChildWnd->nFocusPanel = 1; + break; default: goto def; } @@ -291,10 +295,17 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa { if ((int)wParam == LIST_WINDOW) { - if(ListWndNotifyProc(pChildWnd->hListWnd, wParam, lParam, &Result)) - { - return Result; - } + switch (((LPNMHDR)lParam)->code) { + case NM_SETFOCUS: + pChildWnd->nFocusPanel = 0; + break; + default: + if(ListWndNotifyProc(pChildWnd->hListWnd, wParam, lParam, &Result)) + { + return Result; + } + break; + } } } break; diff --git a/reactos/subsys/system/regedit/listview.c b/reactos/subsys/system/regedit/listview.c index 5776e5da47f..1bd4d04a531 100644 --- a/reactos/subsys/system/regedit/listview.c +++ b/reactos/subsys/system/regedit/listview.c @@ -387,7 +387,7 @@ HWND CreateListView(HWND hwndParent, int id) /* 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/reactos/subsys/system/regedit/main.c b/reactos/subsys/system/regedit/main.c index cd1b534c47a..867304ab6c6 100644 --- a/reactos/subsys/system/regedit/main.c +++ b/reactos/subsys/system/regedit/main.c @@ -185,7 +185,8 @@ int APIENTRY WinMain(HINSTANCE hInstance, /* 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); } diff --git a/reactos/subsys/system/regedit/treeview.c b/reactos/subsys/system/regedit/treeview.c index 5721e3c5365..55311ccbca2 100644 --- a/reactos/subsys/system/regedit/treeview.c +++ b/reactos/subsys/system/regedit/treeview.c @@ -150,7 +150,10 @@ static BOOL InitTreeViewItems(HWND hwndTV, LPTSTR pHostName) if (!AddEntryToTree(hwndTV, hRoot, _T("HKEY_LOCAL_MACHINE"), HKEY_LOCAL_MACHINE, 1)) return FALSE; if (!AddEntryToTree(hwndTV, hRoot, _T("HKEY_USERS"), HKEY_USERS, 1)) return FALSE; if (!AddEntryToTree(hwndTV, hRoot, _T("HKEY_CURRENT_CONFIG"), HKEY_CURRENT_CONFIG, 1)) return FALSE; - + + /* expand and select host name */ + TreeView_Expand(hwndTV, hRoot, TVE_EXPAND); + TreeView_Select(hwndTV, hRoot, TVGN_CARET); return TRUE; } @@ -262,7 +265,7 @@ HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, int id) /* Get the dimensions of the parent window's client area, and create the tree view control. */ GetClientRect(hwndParent, &rcClient); hwndTV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, _T("Tree View"), - WS_VISIBLE | WS_CHILD | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT, + WS_VISIBLE | WS_CHILD | WS_TABSTOP | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT, 0, 0, rcClient.right, rcClient.bottom, hwndParent, (HMENU)id, hInst, NULL); /* Initialize the image list, and add items to the control. */