[DEVMGR]
authorEric Kohl <eric.kohl@reactos.org>
Sat, 9 Jan 2016 22:22:17 +0000 (22:22 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 9 Jan 2016 22:22:17 +0000 (22:22 +0000)
Set the focus to the treeview when the main window recieves a WM_ACTIVATE message.
CORE-10769 #resolve #comment Fixed in r70560.

svn path=/trunk/; revision=70560

reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp
reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp
reactos/dll/win32/devmgr/devmgmt/MainWindow.h

index d923c7d..c902b33 100644 (file)
@@ -291,6 +291,7 @@ CDeviceView::DisplayPropertySheet()
 void
 CDeviceView::SetFocus()
 {
+    ::SetFocus(m_hTreeView);
 }
 
 bool
index 07a1f93..aa33034 100644 (file)
@@ -667,6 +667,12 @@ CDeviceManager::OnCommand(_In_ WPARAM wParam,
     return RetCode;
 }
 
+void
+CDeviceManager::OnActivate(void)
+{
+    m_DeviceView->SetFocus();
+}
+
 LRESULT
 CDeviceManager::OnDestroy(void)
 {
@@ -822,7 +828,11 @@ CDeviceManager::MainWndProc(_In_ HWND hwnd,
             DestroyWindow(hwnd);
             break;
         }
-        
+
+        case WM_ACTIVATE:
+            if (LOWORD(hwnd))
+                This->OnActivate();
+            break;
 
         case WM_DESTROY:
         {
index 3b2e5bc..afd3313 100644 (file)
@@ -66,6 +66,8 @@ private:
         LPARAM lParam
         );
 
+    void OnActivate(void);
+
     bool CreateToolBar(void);
     bool CreateStatusBar(void);