Hey guys I really need some help on how to use
#EM_FINDTEXT http://msdn.microsoft.com/library/defau ... ndtext.asp
The lpstrText is what is confusing me...is a callback needed?Or some peek/poke commands?
using #EM_FINDTEXT
-
- Enthusiast
- Posts: 252
- Joined: Fri Feb 20, 2004 5:43 pm
Here's some quick and easy code that should show you how to use the message. You basically just specify a start and end for the search and the word to find.
But if you're using it for something real, you might want to put a real top value in, rather than just putting a thousand like I did
Code: Select all
OpenWindow(0,0,0,400,400,#PB_Window_SystemMenu | #PB_Window_ScreenCentered,"test")
CreateGadgetList(WindowID(0))
EditorGadget(0,10,10,380,350)
For a=0 To 20
AddGadgetItem(0,a,"This is line "+Str(a))
Next
ButtonGadget(1,10,370,380,20,"Click to find the word 'line'")
word$="line"
text.FINDTEXT
text\chrg\cpmin=0
text\chrg\cpmax=1000
text\lpstrText=@word$
Repeat
ev=WaitWindowEvent()
If ev=#PB_Event_Gadget And EventGadgetID()=1
Repeat
res=SendMessage_(GadgetID(0),#EM_FINDTEXT,#FR_DOWN | #FR_WHOLEWORD,@text.FINDTEXT)
Debug res
text\chrg\cpmin=res+1
Until res<0
text\chrg\cpmin=0
EndIf
Until ev=#PB_Event_CloseWindow
But if you're using it for something real, you might want to put a real top value in, rather than just putting a thousand like I did

-
- User
- Posts: 15
- Joined: Sun Sep 12, 2004 6:41 am
could the last parameter of the #EM_ message not simply be ?
Code: Select all
text
-
- Enthusiast
- Posts: 252
- Joined: Fri Feb 20, 2004 5:43 pm