Computing.Net > Forums > Programming > FindReplace problem

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

FindReplace problem

Reply to Message Icon

Name: Basa
Date: October 12, 2004 at 15:13:56 Pacific
OS: Windows XP
CPU/Ram: AMD/256 DDR
Comment:

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




Sponsored Link
Ads by Google

Response Number 1
Name: Fozzie
Date: October 12, 2004 at 18:08:22 Pacific
Reply:

What problem are you having? Error messages/won't compile, or compiles but no FR dialog box?


0

Response Number 2
Name: Basa
Date: October 17, 2004 at 11:28:44 Pacific
Reply:

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


0

Response Number 3
Name: Basa
Date: October 18, 2004 at 11:01:05 Pacific
Reply:

Sorry again...
When I move the mouse over the dialog box the prog reports a problem.

Basa_Melkiy


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: FindReplace problem

Simple (I hope) batch file problem www.computing.net/answers/programming/simple-i-hope-batch-file-problem/12736.html

Problem reading file in c++ www.computing.net/answers/programming/problem-reading-file-in-c/7826.html

Javascript addition problem. www.computing.net/answers/programming/javascript-addition-problem-/14391.html