Skip to content

Commit

Permalink
Attempt to fix copy selection as find text bug, issue #497.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Oct 7, 2022
1 parent bdae06e commit 08ea311
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -4978,7 +4978,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
}
return TRUE;

case WM_COPYDATA: {
case APPM_COPYDATA: {
HWND hwndFind = GetDlgItem(hwnd, IDC_FINDTEXT);
HWND hwndRepl = GetDlgItem(hwnd, IDC_REPLACETEXT);
LPEDITFINDREPLACE lpefr = (LPEDITFINDREPLACE)GetWindowLongPtr(hwnd, DWLP_USER);
Expand Down
2 changes: 1 addition & 1 deletion src/Notepad2.c
Original file line number Diff line number Diff line change
Expand Up @@ -3929,8 +3929,8 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam) {
DestroyWindow(hDlgFindReplace);
hDlgFindReplace = EditFindReplaceDlg(hwndEdit, &efrData, bReplace);
} else {
SendMessage(hDlgFindReplace, WM_COPYDATA, 0, 0);
SetForegroundWindow(hDlgFindReplace);
SendMessage(hDlgFindReplace, APPM_COPYDATA, 0, 0);
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/Notepad2.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ typedef struct NP2PARAMS {
//#define APPM_CHANGENOTIFYCLEAR (WM_APP + 3)
#define APPM_TRAYMESSAGE (WM_APP + 4) // callback message from system tray
#define APPM_POST_HOTSPOTCLICK (WM_APP + 5)
// TODO: WM_COPYDATA is blocked by the User Interface Privilege Isolation
// https://www.codeproject.com/tips/1017834/how-to-send-data-from-one-process-to-another-in-cs
#define APPM_COPYDATA (WM_APP + 6)

#define ID_WATCHTIMER 0xA000 // file watch timer
#define ID_PASTEBOARDTIMER 0xA001 // paste board timer
Expand Down

0 comments on commit 08ea311

Please sign in to comment.