Skip to content

Commit 9156be3

Browse files
committed
#219 Update find buttons on combo selection change
1 parent 5106f19 commit 9156be3

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

src/Extension/EditHelper.c

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -965,17 +965,7 @@ LRESULT CALLBACK n2e_FindEditWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
965965
switch (uMsg)
966966
{
967967
case WM_PASTE:
968-
if (n2e_FilteredPasteFromClipboard(hwnd))
969-
{
970-
DWORD dwControlID = GetWindowLong(hwnd, GWL_ID);
971-
HWND hParent = GetParent(hwnd);
972-
if (n2e_CheckWindowClassName(hParent, WC_COMBOBOX))
973-
{
974-
dwControlID = GetWindowLong(hParent, GWL_ID);
975-
hParent = GetParent(hParent);
976-
}
977-
PostMessage(hParent, WM_COMMAND, MAKELONG(dwControlID, 1), 0);
978-
}
968+
n2e_FilteredPasteFromClipboard(hwnd);
979969
return 0;
980970
case WM_COMMAND:
981971
switch (LOWORD(wParam))
@@ -1028,7 +1018,6 @@ LRESULT CALLBACK n2e_FindEditWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
10281018
{
10291019
SendMessage(hwnd, EM_SETSEL, cou + 1, car);
10301020
SendMessage(hwnd, EM_REPLACESEL, (WPARAM)TRUE, (LPARAM)L"");
1031-
PostMessage(GetParent(hwndCombo), WM_COMMAND, MAKELONG(idControl, 1), 0);
10321021
}
10331022
}
10341023
break;
@@ -1039,7 +1028,13 @@ LRESULT CALLBACK n2e_FindEditWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
10391028
default:
10401029
break;
10411030
}
1042-
return n2e_CallOriginalWindowProc(hwnd, uMsg, wParam, lParam);
1031+
const auto res = n2e_CallOriginalWindowProc(hwnd, uMsg, wParam, lParam);
1032+
if ((uMsg == WM_SETTEXT) || (uMsg == EM_REPLACESEL))
1033+
{
1034+
const HWND hwndCombo = GetParent(hwnd);
1035+
PostMessage(GetParent(hwndCombo), WM_COMMAND, MAKELONG(GetWindowLong(hwndCombo, GWL_ID), CBN_EDITCHANGE), 0);
1036+
}
1037+
return res;
10431038
}
10441039

10451040
BOOL n2e_EnableClipboardFiltering(const HWND hwnd, const UINT idEdit)

0 commit comments

Comments
 (0)