From 8c50d36968671f26366360f3075bfe3fe372c7f3 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Fri, 13 May 2011 21:09:56 +0000 Subject: [PATCH] [DEVMGMT] - Set the focus for the treeview when the main window gets the focus. - Select the root item after the devices tree has been built. These changes enable the user to navigate the device tree using the keyboard. svn path=/trunk/; revision=51715 --- reactos/base/applications/mscutils/devmgmt/enumdevices.c | 3 +++ reactos/base/applications/mscutils/devmgmt/mainwnd.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/reactos/base/applications/mscutils/devmgmt/enumdevices.c b/reactos/base/applications/mscutils/devmgmt/enumdevices.c index 7da58452be9..b7b24d18151 100644 --- a/reactos/base/applications/mscutils/devmgmt/enumdevices.c +++ b/reactos/base/applications/mscutils/devmgmt/enumdevices.c @@ -415,6 +415,9 @@ ListDevicesByType(HWND hTreeView, (void)TreeView_SortChildren(hTreeView, hRoot, 0); + + (void)TreeView_SelectItem(hTreeView, + hRoot); } diff --git a/reactos/base/applications/mscutils/devmgmt/mainwnd.c b/reactos/base/applications/mscutils/devmgmt/mainwnd.c index c9785097d17..79af9f53b80 100644 --- a/reactos/base/applications/mscutils/devmgmt/mainwnd.c +++ b/reactos/base/applications/mscutils/devmgmt/mainwnd.c @@ -550,7 +550,13 @@ MainWndProc(HWND hwnd, /* Show the window */ ShowWindow(hwnd, Info->nCmdShow); + } + break; + case WM_SETFOCUS: + { + if (Info->hTreeView != NULL) + SetFocus(Info->hTreeView); } break;