[DEVMGMT]
authorEric Kohl <eric.kohl@reactos.org>
Fri, 13 May 2011 21:09:56 +0000 (21:09 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Fri, 13 May 2011 21:09:56 +0000 (21:09 +0000)
- 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
reactos/base/applications/mscutils/devmgmt/mainwnd.c

index 7da5845..b7b24d1 100644 (file)
@@ -415,6 +415,9 @@ ListDevicesByType(HWND hTreeView,
     (void)TreeView_SortChildren(hTreeView,
                                 hRoot,
                                 0);
+
+    (void)TreeView_SelectItem(hTreeView,
+                              hRoot);
 }
 
 
index c978509..79af9f5 100644 (file)
@@ -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;