Skip to content

Commit 27cc5a1

Browse files
authored
Update FindOnPage.md
Added event handlers for match count and match index back
1 parent f2c8a40 commit 27cc5a1

1 file changed

Lines changed: 21 additions & 8 deletions

File tree

FindOnPage.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,15 @@ bool AppWindow::GetMatchCount()
124124
}
125125
//! [GetMatchCount]
126126
```
127+
#### Handle Match Count Changes
127128

129+
```cpp
130+
void OnMatchCountChanged(LONG matchesCount)
131+
{
132+
// Handle match count changes
133+
// Update UI elements or perform actions based on the new match count
134+
}
135+
```
128136
### Retrieve the Index of the Active Match
129137
130138
#### Description
@@ -153,6 +161,15 @@ bool AppWindow::GetActiveMatchIndex()
153161
//! [GetActiveMatchIndex]
154162
```
155163

164+
#### Handle Active Match Index Changes
165+
```cpp
166+
void OnActiveMatchIndexChanged(ICoreWebView2* sender, ICoreWebView2StagingFindActiveMatchIndexChangedEventArgs* args)
167+
{
168+
// Handle active match index changes
169+
// Update UI to reflect the change in the active match index
170+
}
171+
```
172+
156173
### Navigate to the Next Match
157174
158175
#### Description
@@ -259,25 +276,21 @@ interface ICoreWebView2FindConfiguration : IUnknown {
259276
/// Handles the event that's fired when the match count changes.
260277
[uuid(623EFBFB-A19E-43C4-B309-D578511D24AB), object, pointer_default(unique)]
261278
interface ICoreWebView2FindMatchCountChangedEventHandler : IUnknown {
262-
/// Provides the event args when the match count changes.
279+
/// Parameter is the match count.
263280
HRESULT Invoke(LONG matchesCount);
264281
}
265282

266283
/// Handles the event that's fired when the active match index changes.
267284
[uuid(623EFBF9-A19E-43C4-B309-D578511D24A9), object, pointer_default(unique)]
268285
interface ICoreWebView2FindActiveMatchIndexChangedEventHandler : IUnknown {
269-
/// Provides the event args when the active match index changes.
270-
/// Parameter is a sender The sender of this event, representing the current instance of ICoreWebView2Find.
271-
/// Parameter is a args The event args that contain the new active match index.
272-
HRESULT Invoke(
273-
[in] ICoreWebView2* sender,
274-
[in] ICoreWebView2FindActiveMatchIndexChangedEventArgs* args);
286+
/// Parameter is the active match index.
287+
HRESULT Invoke(LONG activeMatchIndex);
275288
}
276289
/// Handles the event that's fired when the find operation completes.
277290
[uuid(2604789D-9553-4246-8E21-B9C74EFAD04F), object, pointer_default(unique)]
278291
interface ICoreWebView2FindOperationCompletedHandler : IUnknown {
279292
/// Provides the event args when the find operation completes.
280-
HRESULT Invoke(HRESULT value, LONG activeMatchIndex, LONG matchesCount);
293+
HRESULT Invoke(HRESULT errorCode, BOOL status);
281294
}
282295

283296
// Interface providing methods and properties for finding and navigating through text in the web view.

0 commit comments

Comments
 (0)