Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to use FindText / ReplaceText / FINDREPLACE?

Featured Replies

Posted

Hi guys,

I am playing around with that functions & struct to get a dialog same as in notepad to find / repleace etc.I get the new dialog to see where I can enter stuff etc.My  problem now is how to catch the messages if I press OK / chancel etc to get the entered data and where?Can anyone post a example code of this?

Thank you

i might have something there actually cos i used it in the log window in protectionid, but i truly have no idea if it works as i umm never used it heh

 

damnit, i got 'lcf-at can not recieve messages'.. i've kept the message window open though so if you clear your inbox i can send you the code

edit 2 : actually its pretty well documented here -> https://msdn.microsoft.com/en-us/library/windows/desktop/ms646918(v=vs.85).aspx and theres sample code in the link, pay attention to the registerwindowmessage part

Edited by evlncrn8

  • Author

Hi evlncrn8,

I still have problems to get any messages I could catch.I made something like this...

		        invoke RtlZeroMemory,addr FR,sizeof FR
                invoke GlobalAlloc, GMEM_FIXED,100
                mov FindBuf,eax		
                mov FR.lStructSize,sizeof FR                
                push hWnd
                pop FR.hwndOwner
                mov FR.Flags,FR_DOWN or FR_NOWHOLEWORD ;or FR_ENABLEHOOK;FR_HIDEUPDOWN or FR_HIDEMATCHCASE or FR_HIDEWHOLEWORD;
                push FindBuf
                pop FR.lpstrFindWhat
                mov FR.wFindWhatLen, 100
                invoke RegisterWindowMessage,chr$("commdlg_FindReplace")
                mov uFindReplaceMsg,eax
                invoke FindText,addr FR
                mov findDBHandle,eax

Now I try in the proc to catch any message from the new search dialog or handle etc but I dont get any.

             mov eax, uFindReplaceMsg
     .elseif uMsg == eax

Also tried to catch BN_CLICKED anywhere but also nothing.I think I still do something wrong etc but what.

greetz

only thing i can see is that you're missing the part that states "When the dialog box is open, your main message loop must include a call to the IsDialogMessagefunction. Pass a handle to the dialog box as a parameter in the IsDialogMessage call.", which seems critical

  • Author

Hi again,

ok stupid me again so I see the problem in my code now.Just did set the uFind.. in eax on wrong line.Now I fixed that and I get the handle to check it with uMsg.Now I have a small another question about checking the flags from the FINDREPLACE struct in lparam.In my example I did set this flags FR_DOWN or FR_NOWHOLEWORD = 1001h.Now if I wanna check the flags after something was entered etc then they are changed and now I wanna check which flag was set new etc.Example, 1001h was changed to 1009h = FR_FINDNEXT flag was added.My stupid question now is how to check that single flag of FR_FINDNEXT now?

             mov edi,lParam
             mov esi,[edi].FINDREPLACE.Flags
             .if  esi == FR_FINDNEXT  ; <---
             .endif

I can use all 3 paramters...

.if  esi == FR_DOWN or FR_NOWHOLEWORD or FR_FINDNEXT

...then its working but anyhow else it should be more right or better only to check FR_FINDNEXT alone.Dont remember anymore.Do you have a short idea how to check that flags more correctly?

PS: I dont use message loops GetWindow / Tanslate... in my codes.

greetz

 mov esi,[edi].FINDREPLACE.Flags
             .if  esi == FR_FINDNEXT  ; <---

lets change it then

mov esi, [edi].FINDREPLACE.Flags

and esi, FR_FINDNEXT

cmp esi, FR_FINDNEXT

jne itsnotfindnextsorestoreesianddootherstuff

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.