c970a53cf51fe4a53d6dea4eff4ee010ab9c1f34
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #define RSF_WHOLESTRING 0x00000001
22 #define RSF_LOOKATKEYS 0x00000002
23 #define RSF_LOOKATVALUES 0x00000004
24 #define RSF_LOOKATDATA 0x00000008
25 #define RSF_MATCHCASE 0x00010000
27 static WCHAR s_szFindWhat
[256];
28 static const WCHAR s_szFindFlags
[] = L
"FindFlags";
29 static const WCHAR s_szFindFlagsR
[] = L
"FindFlagsReactOS";
30 static HWND s_hwndAbortDialog
;
33 static DWORD s_dwFlags
;
34 static WCHAR s_szName
[MAX_PATH
];
35 static DWORD s_cchName
;
36 static const WCHAR s_empty
[] = L
"";
37 static const WCHAR s_backslash
[] = L
"\\";
39 extern VOID
SetValueName(HWND hwndLV
, LPCWSTR pszValueName
);
44 if (PeekMessageW(&msg
, NULL
, 0, 0, PM_REMOVE
))
46 if (msg
.message
== WM_QUIT
)
48 if (!IsDialogMessageW(s_hwndAbortDialog
, &msg
))
50 TranslateMessage(&msg
);
51 DispatchMessageW(&msg
);
57 static LPWSTR
lstrstri(LPCWSTR psz1
, LPCWSTR psz2
)
63 for(i
= 0; i
<= cch1
- cch2
; i
++)
65 if (CompareStringW(LOCALE_SYSTEM_DEFAULT
, NORM_IGNORECASE
,
66 psz1
+ i
, cch2
, psz2
, cch2
) == 2)
67 return (LPWSTR
) (psz1
+ i
);
72 static BOOL
CompareName(LPCWSTR pszName1
, LPCWSTR pszName2
)
74 if (s_dwFlags
& RSF_WHOLESTRING
)
76 if (s_dwFlags
& RSF_MATCHCASE
)
77 return wcscmp(pszName1
, pszName2
) == 0;
79 return _wcsicmp(pszName1
, pszName2
) == 0;
83 if (s_dwFlags
& RSF_MATCHCASE
)
84 return wcsstr(pszName1
, pszName2
) != NULL
;
86 return lstrstri(pszName1
, pszName2
) != NULL
;
96 INT i
, cch1
= wcslen(psz1
), cch2
= wcslen(psz2
);
97 if (dwType
== REG_SZ
|| dwType
== REG_EXPAND_SZ
)
99 if (s_dwFlags
& RSF_WHOLESTRING
)
101 if (s_dwFlags
& RSF_MATCHCASE
)
102 return 2 == CompareStringW(LOCALE_SYSTEM_DEFAULT
, 0,
103 psz1
, cch1
, psz2
, cch2
);
105 return 2 == CompareStringW(LOCALE_SYSTEM_DEFAULT
,
106 NORM_IGNORECASE
, psz1
, cch1
, psz2
, cch2
);
109 for(i
= 0; i
<= cch1
- cch2
; i
++)
111 if (s_dwFlags
& RSF_MATCHCASE
)
113 if (2 == CompareStringW(LOCALE_SYSTEM_DEFAULT
, 0,
114 psz1
+ i
, cch2
, psz2
, cch2
))
119 if (2 == CompareStringW(LOCALE_SYSTEM_DEFAULT
,
120 NORM_IGNORECASE
, psz1
+ i
, cch2
, psz2
, cch2
))
128 int compare(const void *x
, const void *y
)
130 const LPCWSTR
*a
= (const LPCWSTR
*)x
;
131 const LPCWSTR
*b
= (const LPCWSTR
*)y
;
132 return _wcsicmp(*a
, *b
);
138 LPCWSTR pszValueName
,
139 LPWSTR
*ppszFoundSubKey
,
140 LPWSTR
*ppszFoundValueName
)
144 WCHAR szSubKey
[MAX_PATH
];
145 DWORD i
, c
, cb
, type
;
147 LPWSTR
*ppszNames
= NULL
;
153 if(wcslen(pszSubKey
) >= _countof(szSubKey
))
156 wcscpy(szSubKey
, pszSubKey
);
159 lResult
= RegOpenKeyExW(hKey
, szSubKey
, 0, KEY_ALL_ACCESS
, &hSubKey
);
160 if (lResult
!= ERROR_SUCCESS
)
163 lResult
= RegQueryInfoKeyW(hSubKey
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
164 &c
, NULL
, NULL
, NULL
, NULL
);
165 if (lResult
!= ERROR_SUCCESS
)
167 ppszNames
= (LPWSTR
*) malloc(c
* sizeof(LPWSTR
));
168 if (ppszNames
== NULL
)
170 ZeroMemory(ppszNames
, c
* sizeof(LPWSTR
));
172 for(i
= 0; i
< c
; i
++)
177 s_cchName
= _countof(s_szName
);
178 lResult
= RegEnumValueW(hSubKey
, i
, s_szName
, &s_cchName
, NULL
, NULL
,
180 if (lResult
== ERROR_NO_MORE_ITEMS
)
185 if (lResult
!= ERROR_SUCCESS
)
187 if (s_cchName
>= _countof(s_szName
))
190 ppszNames
[i
] = _wcsdup(s_szName
);
193 qsort(ppszNames
, c
, sizeof(LPWSTR
), compare
);
195 if (pszValueName
== NULL
)
196 pszValueName
= ppszNames
[0];
198 for(i
= 0; i
< c
; i
++)
203 if (!fPast
&& _wcsicmp(ppszNames
[i
], pszValueName
) == 0)
211 if ((s_dwFlags
& RSF_LOOKATVALUES
) &&
212 CompareName(ppszNames
[i
], s_szFindWhat
))
214 *ppszFoundSubKey
= _wcsdup(szSubKey
);
215 if (ppszNames
[i
][0] == 0)
216 *ppszFoundValueName
= NULL
;
218 *ppszFoundValueName
= _wcsdup(ppszNames
[i
]);
222 lResult
= RegQueryValueExW(hSubKey
, ppszNames
[i
], NULL
, &type
,
224 if (lResult
!= ERROR_SUCCESS
)
226 pb
= malloc(cb
+ 3); /* To avoid buffer overrun, append 3 NULs */
229 lResult
= RegQueryValueExW(hSubKey
, ppszNames
[i
], NULL
, &type
,
231 if (lResult
!= ERROR_SUCCESS
)
234 /* To avoid buffer overrun, append 3 NUL bytes.
235 NOTE: cb can be an odd number although UNICODE_NULL is two bytes.
236 Two bytes at odd position is not enough to avoid buffer overrun. */
237 pb
[cb
] = pb
[cb
+ 1] = pb
[cb
+ 2] = 0;
239 if ((s_dwFlags
& RSF_LOOKATDATA
) &&
240 CompareData(type
, (LPWSTR
) pb
, s_szFindWhat
))
242 *ppszFoundSubKey
= _wcsdup(szSubKey
);
243 if (ppszNames
[i
][0] == 0)
244 *ppszFoundValueName
= NULL
;
246 *ppszFoundValueName
= _wcsdup(ppszNames
[i
]);
253 if (ppszNames
!= NULL
)
255 for(i
= 0; i
< c
; i
++)
261 lResult
= RegQueryInfoKeyW(hSubKey
, NULL
, NULL
, NULL
, &c
, NULL
, NULL
,
262 NULL
, NULL
, NULL
, NULL
, NULL
);
263 if (lResult
!= ERROR_SUCCESS
)
265 ppszNames
= (LPWSTR
*) malloc(c
* sizeof(LPWSTR
));
266 if (ppszNames
== NULL
)
268 ZeroMemory(ppszNames
, c
* sizeof(LPWSTR
));
270 for(i
= 0; i
< c
; i
++)
275 s_cchName
= _countof(s_szName
);
276 lResult
= RegEnumKeyExW(hSubKey
, i
, s_szName
, &s_cchName
, NULL
, NULL
,
278 if (lResult
== ERROR_NO_MORE_ITEMS
)
283 if (lResult
!= ERROR_SUCCESS
)
285 if (s_cchName
>= _countof(s_szName
))
288 ppszNames
[i
] = _wcsdup(s_szName
);
291 qsort(ppszNames
, c
, sizeof(LPWSTR
), compare
);
293 for(i
= 0; i
< c
; i
++)
298 if ((s_dwFlags
& RSF_LOOKATKEYS
) &&
299 CompareName(ppszNames
[i
], s_szFindWhat
))
301 *ppszFoundSubKey
= malloc(
302 (wcslen(szSubKey
) + wcslen(ppszNames
[i
]) + 2) *
304 if (*ppszFoundSubKey
== NULL
)
308 wcscpy(*ppszFoundSubKey
, szSubKey
);
309 wcscat(*ppszFoundSubKey
, s_backslash
);
312 **ppszFoundSubKey
= 0;
313 wcscat(*ppszFoundSubKey
, ppszNames
[i
]);
314 *ppszFoundValueName
= NULL
;
318 if (RegFindRecurse(hSubKey
, ppszNames
[i
], NULL
, ppszFoundSubKey
,
321 LPWSTR psz
= *ppszFoundSubKey
;
322 *ppszFoundSubKey
= malloc(
323 (wcslen(szSubKey
) + wcslen(psz
) + 2) * sizeof(WCHAR
));
324 if (*ppszFoundSubKey
== NULL
)
328 wcscpy(*ppszFoundSubKey
, szSubKey
);
329 wcscat(*ppszFoundSubKey
, s_backslash
);
332 **ppszFoundSubKey
= 0;
333 wcscat(*ppszFoundSubKey
, psz
);
340 if (ppszNames
!= NULL
)
342 for(i
= 0; i
< c
; i
++)
347 RegCloseKey(hSubKey
);
351 if (ppszNames
!= NULL
)
353 for(i
= 0; i
< c
; i
++)
357 RegCloseKey(hSubKey
);
364 LPCWSTR pszValueName
,
365 LPWSTR
*ppszFoundSubKey
,
366 LPWSTR
*ppszFoundValueName
)
370 HKEY hBaseKey
, hSubKey
;
371 WCHAR szKeyName
[MAX_PATH
];
372 WCHAR szSubKey
[MAX_PATH
];
375 LPWSTR
*ppszNames
= NULL
;
379 if (wcslen(pszSubKey
) >= _countof(szSubKey
))
382 if (RegFindRecurse(hBaseKey
, pszSubKey
, pszValueName
, ppszFoundSubKey
,
386 wcscpy(szSubKey
, pszSubKey
);
387 while(szSubKey
[0] != 0)
392 pch
= wcsrchr(szSubKey
, L
'\\');
395 wcscpy(szKeyName
, szSubKey
);
401 lstrcpynW(szKeyName
, pch
+ 1, MAX_PATH
);
403 lResult
= RegOpenKeyExW(hBaseKey
, szSubKey
, 0, KEY_ALL_ACCESS
,
405 if (lResult
!= ERROR_SUCCESS
)
409 lResult
= RegQueryInfoKeyW(hSubKey
, NULL
, NULL
, NULL
, &c
, NULL
, NULL
,
410 NULL
, NULL
, NULL
, NULL
, NULL
);
411 if (lResult
!= ERROR_SUCCESS
)
414 ppszNames
= (LPWSTR
*) malloc(c
* sizeof(LPWSTR
));
415 if (ppszNames
== NULL
)
417 ZeroMemory(ppszNames
, c
* sizeof(LPWSTR
));
419 for(i
= 0; i
< c
; i
++)
424 s_cchName
= _countof(s_szName
);
425 lResult
= RegEnumKeyExW(hSubKey
, i
, s_szName
, &s_cchName
,
426 NULL
, NULL
, NULL
, NULL
);
427 if (lResult
== ERROR_NO_MORE_ITEMS
)
432 if (lResult
!= ERROR_SUCCESS
)
434 ppszNames
[i
] = _wcsdup(s_szName
);
437 qsort(ppszNames
, c
, sizeof(LPWSTR
), compare
);
440 for(i
= 0; i
< c
; i
++)
445 if (!fPast
&& _wcsicmp(ppszNames
[i
], szKeyName
) == 0)
453 if ((s_dwFlags
& RSF_LOOKATKEYS
) &&
454 CompareName(ppszNames
[i
], s_szFindWhat
))
456 *ppszFoundSubKey
= malloc(
457 (wcslen(szSubKey
) + wcslen(ppszNames
[i
]) + 2) *
459 if (*ppszFoundSubKey
== NULL
)
463 wcscpy(*ppszFoundSubKey
, szSubKey
);
464 wcscat(*ppszFoundSubKey
, s_backslash
);
467 **ppszFoundSubKey
= 0;
468 wcscat(*ppszFoundSubKey
, ppszNames
[i
]);
469 *ppszFoundValueName
= NULL
;
473 if (RegFindRecurse(hSubKey
, ppszNames
[i
], NULL
,
474 ppszFoundSubKey
, ppszFoundValueName
))
476 LPWSTR psz
= *ppszFoundSubKey
;
477 *ppszFoundSubKey
= malloc(
478 (wcslen(szSubKey
) + wcslen(psz
) + 2) *
480 if (*ppszFoundSubKey
== NULL
)
484 wcscpy(*ppszFoundSubKey
, szSubKey
);
485 wcscat(*ppszFoundSubKey
, s_backslash
);
488 **ppszFoundSubKey
= 0;
489 wcscat(*ppszFoundSubKey
, psz
);
494 if (ppszNames
!= NULL
)
496 for(i
= 0; i
< c
; i
++)
502 if (hBaseKey
!= hSubKey
)
503 RegCloseKey(hSubKey
);
506 if (*phKey
== HKEY_CLASSES_ROOT
)
508 *phKey
= HKEY_CURRENT_USER
;
509 if (RegFindRecurse(*phKey
, s_empty
, NULL
, ppszFoundSubKey
,
514 if (*phKey
== HKEY_CURRENT_USER
)
516 *phKey
= HKEY_LOCAL_MACHINE
;
517 if (RegFindRecurse(*phKey
, s_empty
, NULL
, ppszFoundSubKey
,
522 if (*phKey
== HKEY_LOCAL_MACHINE
)
525 if (RegFindRecurse(*phKey
, s_empty
, NULL
, ppszFoundSubKey
,
530 if (*phKey
== HKEY_USERS
)
532 *phKey
= HKEY_CURRENT_CONFIG
;
533 if (RegFindRecurse(*phKey
, s_empty
, NULL
, ppszFoundSubKey
,
539 if (ppszNames
!= NULL
)
541 for(i
= 0; i
< c
; i
++)
545 if (hBaseKey
!= hSubKey
)
546 RegCloseKey(hSubKey
);
550 if (ppszNames
!= NULL
)
552 for(i
= 0; i
< c
; i
++)
556 if (hBaseKey
!= hSubKey
)
557 RegCloseKey(hSubKey
);
562 static DWORD
GetFindFlags(void)
565 DWORD dwType
, dwValue
, cbData
;
566 DWORD dwFlags
= RSF_LOOKATKEYS
| RSF_LOOKATVALUES
| RSF_LOOKATDATA
;
568 if (RegOpenKeyW(HKEY_CURRENT_USER
, g_szGeneralRegKey
, &hKey
) == ERROR_SUCCESS
)
570 /* Retrieve flags from registry key */
571 cbData
= sizeof(dwValue
);
572 if (RegQueryValueExW(hKey
, s_szFindFlags
, NULL
, &dwType
, (LPBYTE
) &dwValue
, &cbData
) == ERROR_SUCCESS
)
574 if (dwType
== REG_DWORD
)
575 dwFlags
= (dwFlags
& ~0x0000FFFF) | ((dwValue
& 0x0000FFFF) << 0);
578 /* Retrieve ReactOS Regedit specific flags from registry key */
579 cbData
= sizeof(dwValue
);
580 if (RegQueryValueExW(hKey
, s_szFindFlagsR
, NULL
, &dwType
, (LPBYTE
) &dwValue
, &cbData
) == ERROR_SUCCESS
)
582 if (dwType
== REG_DWORD
)
583 dwFlags
= (dwFlags
& ~0xFFFF0000) | ((dwValue
& 0x0000FFFF) << 16);
591 static void SetFindFlags(DWORD dwFlags
)
597 if (RegCreateKeyExW(HKEY_CURRENT_USER
, g_szGeneralRegKey
, 0, NULL
, REG_OPTION_NON_VOLATILE
, KEY_ALL_ACCESS
, NULL
, &hKey
, &dwDisposition
) == ERROR_SUCCESS
)
599 dwData
= (dwFlags
>> 0) & 0x0000FFFF;
600 RegSetValueExW(hKey
, s_szFindFlags
, 0, REG_DWORD
, (const BYTE
*) &dwData
, sizeof(dwData
));
602 dwData
= (dwFlags
>> 16) & 0x0000FFFF;
603 RegSetValueExW(hKey
, s_szFindFlagsR
, 0, REG_DWORD
, (const BYTE
*) &dwData
, sizeof(dwData
));
609 static INT_PTR CALLBACK
AbortFindDialogProc(HWND hDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
611 UNREFERENCED_PARAMETER(lParam
);
612 UNREFERENCED_PARAMETER(hDlg
);
621 switch(HIWORD(wParam
))
624 switch(LOWORD(wParam
))
637 BOOL
FindNext(HWND hWnd
)
642 WCHAR szFullKey
[512];
643 LPCWSTR pszValueName
;
644 LPWSTR pszFoundSubKey
, pszFoundValueName
;
646 if (wcslen(s_szFindWhat
) == 0)
652 s_dwFlags
= GetFindFlags();
654 pszKeyPath
= GetItemPath(g_pChildWnd
->hTreeWnd
, 0, &hKeyRoot
);
655 if (pszKeyPath
== NULL
)
657 hKeyRoot
= HKEY_CLASSES_ROOT
;
658 pszKeyPath
= s_empty
;
661 /* Create abort find dialog */
662 s_hwndAbortDialog
= CreateDialogW(GetModuleHandle(NULL
),
663 MAKEINTRESOURCEW(IDD_FINDING
), hWnd
, AbortFindDialogProc
);
664 if (s_hwndAbortDialog
)
666 ShowWindow(s_hwndAbortDialog
, SW_SHOW
);
667 UpdateWindow(s_hwndAbortDialog
);
671 pszValueName
= GetValueName(g_pChildWnd
->hListWnd
, -1);
673 EnableWindow(hFrameWnd
, FALSE
);
674 EnableWindow(g_pChildWnd
->hTreeWnd
, FALSE
);
675 EnableWindow(g_pChildWnd
->hListWnd
, FALSE
);
676 EnableWindow(g_pChildWnd
->hAddressBarWnd
, FALSE
);
678 fSuccess
= RegFindWalk(&hKeyRoot
, pszKeyPath
, pszValueName
,
679 &pszFoundSubKey
, &pszFoundValueName
);
681 EnableWindow(hFrameWnd
, TRUE
);
682 EnableWindow(g_pChildWnd
->hTreeWnd
, TRUE
);
683 EnableWindow(g_pChildWnd
->hListWnd
, TRUE
);
684 EnableWindow(g_pChildWnd
->hAddressBarWnd
, TRUE
);
686 if (s_hwndAbortDialog
)
688 DestroyWindow(s_hwndAbortDialog
);
689 s_hwndAbortDialog
= NULL
;
694 GetKeyName(szFullKey
, ARRAY_SIZE(szFullKey
), hKeyRoot
, pszFoundSubKey
);
695 SelectNode(g_pChildWnd
->hTreeWnd
, szFullKey
);
696 free(pszFoundSubKey
);
698 if (pszFoundValueName
!= NULL
)
700 SetValueName(g_pChildWnd
->hListWnd
, pszFoundValueName
);
701 free(pszFoundValueName
);
702 SetFocus(g_pChildWnd
->hListWnd
);
706 SetFocus(g_pChildWnd
->hTreeWnd
);
709 return fSuccess
|| s_bAbort
;
712 static INT_PTR CALLBACK
FindDialogProc(HWND hDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
718 static WCHAR s_szSavedFindValue
[256];
723 dwFlags
= GetFindFlags();
725 hControl
= GetDlgItem(hDlg
, IDC_LOOKAT_KEYS
);
727 SendMessageW(hControl
, BM_SETCHECK
, (dwFlags
& RSF_LOOKATKEYS
) ? TRUE
: FALSE
, 0);
729 hControl
= GetDlgItem(hDlg
, IDC_LOOKAT_VALUES
);
731 SendMessageW(hControl
, BM_SETCHECK
, (dwFlags
& RSF_LOOKATVALUES
) ? TRUE
: FALSE
, 0);
733 hControl
= GetDlgItem(hDlg
, IDC_LOOKAT_DATA
);
735 SendMessageW(hControl
, BM_SETCHECK
, (dwFlags
& RSF_LOOKATDATA
) ? TRUE
: FALSE
, 0);
737 /* Match whole string */
738 hControl
= GetDlgItem(hDlg
, IDC_MATCHSTRING
);
740 SendMessageW(hControl
, BM_SETCHECK
, (dwFlags
& RSF_WHOLESTRING
) ? TRUE
: FALSE
, 0);
742 /* Case sensitivity */
743 hControl
= GetDlgItem(hDlg
, IDC_MATCHCASE
);
745 SendMessageW(hControl
, BM_SETCHECK
, (dwFlags
& RSF_MATCHCASE
) ? TRUE
: FALSE
, 0);
747 hControl
= GetDlgItem(hDlg
, IDC_FINDWHAT
);
750 SetWindowTextW(hControl
, s_szSavedFindValue
);
752 SendMessageW(hControl
, EM_SETSEL
, 0, -1);
761 switch(HIWORD(wParam
))
764 switch(LOWORD(wParam
))
769 hControl
= GetDlgItem(hDlg
, IDC_LOOKAT_KEYS
);
770 if (hControl
&& (SendMessageW(hControl
, BM_GETCHECK
, 0, 0) == BST_CHECKED
))
771 dwFlags
|= RSF_LOOKATKEYS
;
773 hControl
= GetDlgItem(hDlg
, IDC_LOOKAT_VALUES
);
774 if (hControl
&& (SendMessageW(hControl
, BM_GETCHECK
, 0, 0) == BST_CHECKED
))
775 dwFlags
|= RSF_LOOKATVALUES
;
777 hControl
= GetDlgItem(hDlg
, IDC_LOOKAT_DATA
);
778 if (hControl
&& (SendMessageW(hControl
, BM_GETCHECK
, 0, 0) == BST_CHECKED
))
779 dwFlags
|= RSF_LOOKATDATA
;
781 hControl
= GetDlgItem(hDlg
, IDC_MATCHSTRING
);
782 if (hControl
&& (SendMessageW(hControl
, BM_GETCHECK
, 0, 0) == BST_CHECKED
))
783 dwFlags
|= RSF_WHOLESTRING
;
785 hControl
= GetDlgItem(hDlg
, IDC_MATCHCASE
);
786 if (hControl
&& (SendMessageW(hControl
, BM_GETCHECK
, 0, 0) == BST_CHECKED
))
787 dwFlags
|= RSF_MATCHCASE
;
789 SetFindFlags(dwFlags
);
791 hControl
= GetDlgItem(hDlg
, IDC_FINDWHAT
);
793 GetWindowTextW(hControl
, s_szFindWhat
, ARRAY_SIZE(s_szFindWhat
));
804 switch(LOWORD(wParam
))
807 GetWindowTextW((HWND
) lParam
, s_szSavedFindValue
, ARRAY_SIZE(s_szSavedFindValue
));
808 hControl
= GetDlgItem(hDlg
, IDOK
);
811 lStyle
= GetWindowLongPtr(hControl
, GWL_STYLE
);
812 if (s_szSavedFindValue
[0])
813 lStyle
&= ~WS_DISABLED
;
815 lStyle
|= WS_DISABLED
;
816 SetWindowLongPtr(hControl
, GWL_STYLE
, lStyle
);
817 RedrawWindow(hControl
, NULL
, NULL
, RDW_INVALIDATE
);
827 void FindNextMessageBox(HWND hWnd
)
831 WCHAR msg
[128], caption
[128];
833 LoadStringW(hInst
, IDS_FINISHEDFIND
, msg
, ARRAY_SIZE(msg
));
834 LoadStringW(hInst
, IDS_APP_TITLE
, caption
, ARRAY_SIZE(caption
));
835 MessageBoxW(hWnd
, msg
, caption
, MB_ICONINFORMATION
);
839 void FindDialog(HWND hWnd
)
841 if (DialogBoxParamW(GetModuleHandle(NULL
), MAKEINTRESOURCEW(IDD_FIND
),
842 hWnd
, FindDialogProc
, 0) != 0)
844 FindNextMessageBox(hWnd
);