[PATCH 1/7] regedit: Move the listview's NM_SETFOCUS handling to listview.c

Hugh McMaster hugh.mcmaster at outlook.com
Mon May 29 03:20:02 CDT 2017


Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 programs/regedit/childwnd.c | 12 ++++--------
 programs/regedit/listview.c |  3 +++
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c
index 34c6a94..6538842 100644
--- a/programs/regedit/childwnd.c
+++ b/programs/regedit/childwnd.c
@@ -471,14 +471,10 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
             default:
                 return 0; /* goto def; */
             }
-        } else
-            if (((int)wParam == LIST_WINDOW) && (g_pChildWnd != NULL)) {
-		if (((LPNMHDR)lParam)->code == NM_SETFOCUS) {
-		    g_pChildWnd->nFocusPanel = 1;
-		} else if (!SendMessageW(g_pChildWnd->hListWnd, WM_NOTIFY_REFLECT, wParam, lParam)) {
-                    goto def;
-                }
-            }
+        } else if ((int)wParam == LIST_WINDOW && g_pChildWnd != NULL) {
+            if (!SendMessageW(g_pChildWnd->hListWnd, WM_NOTIFY_REFLECT, wParam, lParam))
+                goto def;
+        }
         break;
 
     case WM_SIZE:
diff --git a/programs/regedit/listview.c b/programs/regedit/listview.c
index 3ebba33..b42af8e 100644
--- a/programs/regedit/listview.c
+++ b/programs/regedit/listview.c
@@ -420,6 +420,9 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
                 SendMessageW(hFrameWnd, WM_COMMAND, ID_EDIT_MODIFY, 0);
             }
             break;
+        case NM_SETFOCUS:
+            g_pChildWnd->nFocusPanel = 1;
+            break;
         case NM_DBLCLK: {
                 NMITEMACTIVATE* nmitem = (LPNMITEMACTIVATE)lParam;
                 LVHITTESTINFO info;
-- 
2.7.4




More information about the wine-patches mailing list