[REGEDIT] Display search finished messagebox when using Find Next (F3) menu item (#3371)

This repeats behaviour of Windows Regedit. CORE-17368
This commit is contained in:
Oleg Dubinskiy 2020-11-14 22:09:59 +02:00 committed by Stanislav Motylkov
parent bc90cbbb88
commit 9de8787187
No known key found for this signature in database
GPG key ID: AFE513258CBA9E92
3 changed files with 15 additions and 9 deletions

View file

@ -810,18 +810,23 @@ static INT_PTR CALLBACK FindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR
return iResult; return iResult;
} }
void FindNextMessageBox(HWND hWnd)
{
if (!FindNext(hWnd))
{
WCHAR msg[128], caption[128];
LoadStringW(hInst, IDS_FINISHEDFIND, msg, COUNT_OF(msg));
LoadStringW(hInst, IDS_APP_TITLE, caption, COUNT_OF(caption));
MessageBoxW(hWnd, msg, caption, MB_ICONINFORMATION);
}
}
void FindDialog(HWND hWnd) void FindDialog(HWND hWnd)
{ {
if (DialogBoxParamW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_FIND), if (DialogBoxParamW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_FIND),
hWnd, FindDialogProc, 0) != 0) hWnd, FindDialogProc, 0) != 0)
{ {
if (!FindNext(hWnd)) FindNextMessageBox(hWnd);
{
WCHAR msg[128], caption[128];
LoadStringW(hInst, IDS_FINISHEDFIND, msg, COUNT_OF(msg));
LoadStringW(hInst, IDS_APP_TITLE, caption, COUNT_OF(caption));
MessageBoxW(hWnd, msg, caption, MB_ICONINFORMATION);
}
} }
} }

View file

@ -1230,7 +1230,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
FindDialog(hWnd); FindDialog(hWnd);
break; break;
case ID_EDIT_FINDNEXT: case ID_EDIT_FINDNEXT:
FindNext(hWnd); FindNextMessageBox(hWnd);
break; break;
case ID_EDIT_COPYKEYNAME: case ID_EDIT_COPYKEYNAME:
CopyKeyName(hWnd, hKeyRoot, keyPath); CopyKeyName(hWnd, hKeyRoot, keyPath);

View file

@ -103,6 +103,7 @@ extern int InfoMessageBox(HWND hWnd, UINT uType, LPCWSTR lpTitle, LPCWSTR lpMess
/* find.c */ /* find.c */
extern void FindDialog(HWND hWnd); extern void FindDialog(HWND hWnd);
extern BOOL FindNext(HWND hWnd); extern BOOL FindNext(HWND hWnd);
extern void FindNextMessageBox(HWND hWnd);
/* framewnd.c */ /* framewnd.c */
extern LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM); extern LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);