From 59bfeeba288eeece694af92746cb5c90a6c5795e Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 8 Oct 2008 11:44:24 -0700 Subject: [PATCH] regedit: Pass VK_DELETE messages to Listview/Treeview child windows. --- programs/regedit/framewnd.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/programs/regedit/framewnd.c b/programs/regedit/framewnd.c index ca836e2..4fc7f44 100644 --- a/programs/regedit/framewnd.c +++ b/programs/regedit/framewnd.c @@ -681,7 +681,8 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) break; } case ID_EDIT_DELETE: - if (GetFocus() == g_pChildWnd->hTreeWnd) { + HWND hWndDelete = GetFocus(); + if (hWndDelete == g_pChildWnd->hTreeWnd) { WCHAR* keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot); if (keyPath == 0 || *keyPath == 0) { MessageBeep(MB_ICONHAND); @@ -689,7 +690,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) DeleteNode(g_pChildWnd->hTreeWnd, 0); } HeapFree(GetProcessHeap(), 0, keyPath); - } else if (GetFocus() == g_pChildWnd->hListWnd) { + } else if (hWndDelete == g_pChildWnd->hListWnd) { WCHAR* keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot); curIndex = ListView_GetNextItem(g_pChildWnd->hListWnd, -1, LVNI_SELECTED); while(curIndex != -1) { @@ -713,7 +714,10 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) } RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath, NULL); HeapFree(GetProcessHeap(), 0, keyPath); - } + } else if (IsChild(g_pChildWnd->hTreeWnd, hWndDelete) || + IsChild(g_pChildWnd->hListWnd, hWndDelete)) { + SendMessage(hWndDelete, WM_KEYDOWN, VK_DELETE, 0); + } break; case ID_EDIT_MODIFY: { -- 1.5.4.5