Hi,
You would have to use these procedures :
- TChromium.Find
- TChromium.StopFinding
The CEF3 code comments for
TChromium.Find are these :
Code: Select all
///
// Search for |searchText|. |identifier| must be a unique ID and these IDs
// must strictly increase so that newer requests always have greater IDs than
// older requests. If |identifier| is zero or less than the previous ID value
// then it will be automatically assigned a new valid ID. |forward| indicates
// whether to search forward or backward within the page. |matchCase|
// indicates whether the search should be case-sensitive. |findNext| indicates
// whether this is the first request or a follow-up. The cef_find_handler_t
// instance, if any, returned via cef_client_t::GetFindHandler will be called
// to report find results.
///
And the code comments for
TChromium.StopFinding are these :
Code: Select all
///
// Cancel all searches that are currently going on.
///
You may also have to use the
TChromium.OnFindResult event which has these code comments :
Code: Select all
///
// Called to report find results returned by cef_browser_host_t::find().
// |identifer| is the identifier passed to find(), |count| is the number of
// matches currently identified, |selectionRect| is the location of where the
// match was found (in window coordinates), |activeMatchOrdinal| is the
// current position in the search results, and |finalUpdate| is true (1) if
// this is the last find notification.
///
Modify one of the demos and add a TEdit to enter text.
Then add 2 buttons that would call TChromium.Find and TChromium.StopFinding respectively.
When you click the "Find" button you will see that the document highlights the text you tried to search.
When you want to clear the highlighted text then you should call the "StopFinding" button.
If you need to know where are the find results then use TChromium.OnFindResult.