Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all!
How can I find or replace in API?
I tried to write a code according to msdn tutorial but it doesn't work...Here is what I did:
The defines:
UINT uFindReplaceMsg;
HWND DlgFind;A function:
BOOL FindReplace(HWND hwnd){
FINDREPLACE fr;
CHAR szFindWhat[80] = "";
ZeroMemory(&fr, sizeof(fr));
fr.lStructSize = sizeof(fr);
fr.hwndOwner = hwnd;
fr.lpstrFindWhat = szFindWhat;
fr.wFindWhatLen = 80;
fr.Flags = 0;DlgFind = FindText(&fr);
}In GetMessage loop:
while(GetMessage(&messages, NULL, 0, 0))
{
if(!IsDialogMessage(DlgFind, &messages)){
TranslateMessage(&messages);
DispatchMessage(&messages);
}
}In the Windows Procedure:
if(message == uFindReplaceMsg){
LPFINDREPLACE lpfr = (LPFINDREPLACE)lParam;if (lpfr->Flags & FR_DIALOGTERM){
DlgFind = NULL;
return 0;
}if (lpfr->Flags & FR_FINDNEXT){
//SearchFile(lpfr->lpstrFindWhat,
//(BOOL) (lpfr->Flags & FR_DOWN),
//(BOOL) (lpfr->Flags & FR_MATCHCASE));
}
}
(The Comments are because the functions don't exist...)In case WM_CREATE:
uFindReplaceMsg = RegisterWindowMessage(FINDMSGSTRING);
I think I don't use the functions right...
Can anyone help me?Basa_Melkiy

Sorry I didn't show up for a while, I was sick...
The dialog box is displayed but the program reports a problem after 3-5 seconds and says it must close.Basa_Melkiy

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |