From 496764ad587d9f11da38591f8d92b221c1e67cdd Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 9 Jan 2016 22:22:17 +0000 Subject: [PATCH] [DEVMGR] 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 | 1 + reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp | 12 +++++++++++- reactos/dll/win32/devmgr/devmgmt/MainWindow.h | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp b/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp index d923c7d82e0..c902b33fb56 100644 --- a/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp +++ b/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp @@ -291,6 +291,7 @@ CDeviceView::DisplayPropertySheet() void CDeviceView::SetFocus() { + ::SetFocus(m_hTreeView); } bool diff --git a/reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp b/reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp index 07a1f93ef9c..aa3303435d2 100644 --- a/reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp +++ b/reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp @@ -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: { diff --git a/reactos/dll/win32/devmgr/devmgmt/MainWindow.h b/reactos/dll/win32/devmgr/devmgmt/MainWindow.h index 3b2e5bc3ff8..afd331344da 100644 --- a/reactos/dll/win32/devmgr/devmgmt/MainWindow.h +++ b/reactos/dll/win32/devmgr/devmgmt/MainWindow.h @@ -66,6 +66,8 @@ private: LPARAM lParam ); + void OnActivate(void); + bool CreateToolBar(void); bool CreateStatusBar(void);