-
Notifications
You must be signed in to change notification settings - Fork 57
Create FindOnPage.md #4399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
maxwellmyers
wants to merge
81
commits into
main
Choose a base branch
from
api-findonpage
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Create FindOnPage.md #4399
Changes from 1 commit
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
fe8893d
Create FindOnPage.md
maxwellmyers eae4c7e
Update FindOnPage.md
maxwellmyers 6c2f522
Update FindOnPage.md
maxwellmyers 18600e6
Update FindOnPage.md
maxwellmyers f2c8a40
Update FindOnPage.md
maxwellmyers 27cc5a1
Update FindOnPage.md
maxwellmyers 866f3fe
Update FindOnPage.md
maxwellmyers bdcfbb5
Update FindOnPage.md
maxwellmyers bcb312d
Update FindOnPage.md
maxwellmyers 0cbebb2
Update FindOnPage.md
maxwellmyers b88741d
Update FindOnPage.md
maxwellmyers 9d9ef6d
Update FindOnPage.md
maxwellmyers 09c3bd8
Update FindOnPage.md
maxwellmyers 15050e2
Update FindOnPage.md
maxwellmyers 121afee
Update FindOnPage.md
maxwellmyers 83a0f0c
Update FindOnPage.md
maxwellmyers b1a63fb
Update FindOnPage.md
maxwellmyers af525b6
Update FindOnPage.md
maxwellmyers 52ba7d4
Update FindOnPage.md
maxwellmyers e6c8905
Update FindOnPage.md
maxwellmyers 42b3cdd
Update FindOnPage.md
maxwellmyers f0b9e32
Update FindOnPage.md
maxwellmyers 2320ee1
Update FindOnPage.md
maxwellmyers 5e54814
Update FindOnPage.md
maxwellmyers 151f501
Update FindOnPage.md
maxwellmyers 87f7dba
deleted 438-443
maxwellmyers e66ba7a
deleted usage example from the api def
maxwellmyers 0a6971e
line length corrected
maxwellmyers 4c87604
217 to 2_17
maxwellmyers d28354a
Update FindOnPage.md
maxwellmyers 4de44af
Updated Callback in StartFind and the description of the find op comp…
maxwellmyers b3b07ae
Updated the Configure/Execute Find
maxwellmyers a74ffa9
Created a flow for using custom dialog and default dialog within star…
maxwellmyers a33d8c0
Update FindOnPage.md
maxwellmyers cb1913d
Update FindOnPage.md
maxwellmyers fcf1ebb
Update FindOnPage.md
maxwellmyers 990ed88
Update FindOnPage.md
maxwellmyers 2f71770
Update FindOnPage.md
maxwellmyers eeceaf0
Update FindOnPage.md
maxwellmyers e0a860c
Update FindOnPage.md
maxwellmyers 5f4f6c7
Update FindOnPage.md
maxwellmyers 7d1db17
Update FindOnPage.md
maxwellmyers b4e4f7d
Update FindOnPage.md
maxwellmyers 9c6460b
Update FindOnPage.md
maxwellmyers f68c12c
Update FindOnPage.md
maxwellmyers 7528998
Update FindOnPage.md
maxwellmyers 374292a
Update FindOnPage.md
maxwellmyers e5cde96
Changed search to find
maxwellmyers 1315049
Update FindOnPage.md
maxwellmyers 0f40d23
Update FindOnPage.md
maxwellmyers 9e9f995
Update FindOnPage.md
maxwellmyers 6dd9024
Update FindOnPage.md
maxwellmyers 24c70af
Update FindOnPage.md
maxwellmyers db2d318
Update FindOnPage.md
maxwellmyers 57389cf
Update FindOnPage.md
maxwellmyers b9a14b6
changed shouldhighlight and supress dialiog
maxwellmyers 0d2f601
Update FindOnPage.md
maxwellmyers 99a713f
Update FindOnPage.md
maxwellmyers 6ccdf17
Update FindOnPage.md
maxwellmyers b20d9a6
Update FindOnPage.md
maxwellmyers 4788c42
Update FindOnPage.md
maxwellmyers d4be4a6
Update FindOnPage.md
maxwellmyers aa1a1e5
Update FindOnPage.md
maxwellmyers d2b65a2
Update FindOnPage.md
maxwellmyers c40a79b
added 2 default UI screenshots
maxwellmyers c062611
Update FindOnPage.md
maxwellmyers 18ea6f5
Update FindOnPage.md
maxwellmyers c4988da
Update FindOnPage.md
maxwellmyers 99bfd11
Update FindOnPage.md
maxwellmyers 6eeaf1e
Changed FindConfig -> FindOptions
maxwellmyers 05838bf
Update FindOnPage.md
maxwellmyers 7e99d7d
Update FindOnPage.md
maxwellmyers 3e608aa
Update FindOnPage.md
maxwellmyers c619dbb
Update FindOnPage.md
maxwellmyers 3ed7d68
Update FindOnPage.md
maxwellmyers 571626f
Update FindOnPage.md
maxwellmyers 4257d86
Update FindOnPage.md
maxwellmyers 5e6d5dd
Update FindOnPage.md
maxwellmyers d1299fc
Update FindOnPage.md
maxwellmyers 1675000
Update FindOnPage.md with experimental find options/
maxwellmyers d1b34c0
Update FindOnPage.md for find session terminology
maxwellmyers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,382 @@ | ||
# WebView2Find API | ||
|
||
## Background | ||
|
||
The WebView2Find API provides methods and events to support text finding and navigation within a WebView2 control. | ||
It allows developers to initiate find operations, navigate between find results, and customize various find configurations. | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Examples | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
#### Description | ||
To initiate a find operation within a WebView2 control, developers can utilize the `StartFindOnPage` method. | ||
This method allows specifying the find term and configuring other find parameters using the `ICoreWebView2FindConfiguration` interface. | ||
|
||
#### Create/Specify a Find Configuration | ||
|
||
|
||
|
||
```cpp | ||
ICoreWebView2FindConfiguration CreateFindConfiguration() | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
ICoreWebView2Environment5 environment = webView2Control.GetEnvironment(); | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ICoreWebView2FindConfiguration configuration; | ||
environment.CreateFindConfiguration(out configuration); | ||
configuration.FindTerm = "example"; | ||
configuration.FindDirection = COREWEBVIEW2_FIND_DIRECTION.COREWEBVIEW2_FIND_DIRECTION_FORWARD; | ||
configuration.IsCaseSensitive = false; | ||
configuration.ShouldMatchWord = false; | ||
return configuration; | ||
} | ||
``` | ||
|
||
### Start a Find Operation | ||
|
||
|
||
```cpp | ||
//! [StartFindOnPage] | ||
void AppWindow::StartFindOnPage(const std::wstring& findTerm) | ||
{ | ||
// Get the find interface | ||
auto find = webView2Control.GetFind(); | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// Create find configuration | ||
auto configuration = CreateFindConfiguration(); | ||
|
||
// Start the find operation | ||
find.StartFind(configuration, OnFindOperationCompleted); | ||
} | ||
//! [StartFindOnPage] | ||
``` | ||
### Stop an existing find operation | ||
#### Description | ||
To stop an ongoing find operation within a WebView2 control, developers can use the `StopFind` method of the `ICoreWebView2Find` interface. | ||
```cpp | ||
//! [StopFind] | ||
void AppWindow::StopFind() | ||
{ | ||
// Get the find interface | ||
auto find = webView2Control.GetFind(); | ||
|
||
// Stop the find operation | ||
find.StopFind(); | ||
} | ||
//! [StopFind] | ||
``` | ||
|
||
### Retrieve the Number of Matches | ||
|
||
#### Description | ||
To retrieve the total number of matches found during a find operation within a WebView2 control, developers can utilize the `GetMatchCount` method. | ||
|
||
|
||
```cpp | ||
//! [GetMatchCount] | ||
void AppWindow::GetMatchCount() | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
// Get the find interface | ||
auto find = webView2Control.GetFind(); | ||
|
||
// Get the match count | ||
LONG matchCount; | ||
find.GetMatchesCount(&matchCount); | ||
|
||
// Update UI or handle matchCount | ||
} | ||
//! [GetMatchCount] | ||
``` | ||
|
||
### Retrieve the Index of the Active Match | ||
|
||
#### Description | ||
Developers can retrieve the index of the currently active match within a WebView2 control using the `GetActiveMatchIndex` method. | ||
|
||
|
||
```cpp | ||
//! [GetActiveMatchIndex] | ||
void AppWindow::GetActiveMatchIndex() | ||
{ | ||
// Get the find interface | ||
auto find = webView2Control.GetFind(); | ||
|
||
// Get the active match index | ||
LONG activeMatchIndex; | ||
find.GetActiveMatchIndex(&activeMatchIndex); | ||
|
||
// Update UI or handle activeMatchIndex | ||
} | ||
//! [GetActiveMatchIndex] | ||
``` | ||
|
||
### Navigate to the Next Match | ||
|
||
#### Description | ||
To navigate to the next match found during a find operation within a WebView2 control, developers can use the `FindNext` method. | ||
|
||
|
||
```cpp | ||
//! [FindNext] | ||
void AppWindow::FindNext() | ||
{ | ||
// Get the find interface | ||
auto find = webView2Control.GetFind(); | ||
|
||
// Find the next occurrence | ||
find.FindNext(); | ||
} | ||
//! [FindNext] | ||
``` | ||
|
||
### Navigate to the Previous Match | ||
|
||
#### Description | ||
To navigate to the previous match found during a find operation within a WebView2 control, developers can use the `FindPrevious` method. | ||
|
||
|
||
```cpp | ||
//! [FindPrevious] | ||
void AppWindow::FindPrevious() | ||
{ | ||
// Get the find interface | ||
auto find = webView2Control.GetFind(); | ||
|
||
// Find the previous occurrence | ||
find.FindPrevious(); | ||
} | ||
//! [FindPrevious] | ||
``` | ||
|
||
#### Handle Match Count Changes | ||
|
||
```cpp | ||
void OnMatchCountChanged(LONG matchesCount) | ||
{ | ||
// Handle match count changes | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Update UI elements or perform actions based on the new match count | ||
} | ||
``` | ||
#### Handle Active Match Index Changes | ||
```cpp | ||
void OnActiveMatchIndexChanged(ICoreWebView2* sender, ICoreWebView2StagingFindActiveMatchIndexChangedEventArgs* args) | ||
{ | ||
// Handle active match index changes | ||
// Update UI to reflect the change in the active match index | ||
} | ||
``` | ||
|
||
#### Handle Find Operation Completion | ||
|
||
```cpp | ||
void OnFindOperationCompleted(HRESULT value, LONG activeMatchIndex, LONG matchesCount) | ||
{ | ||
// Handle find operation completion | ||
// Update UI elements, display search results, or handle errors | ||
} | ||
``` | ||
## API Details | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
```csharp | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// Specifies the direction of find Parameters. | ||
[v1_enum] | ||
typedef enum COREWEBVIEW2_FIND_DIRECTION { | ||
/// Specifies a forward find in the document. | ||
COREWEBVIEW2_FIND_DIRECTION_FORWARD, | ||
/// Specifies a backwards find in the document. | ||
COREWEBVIEW2_FIND_DIRECTION_BACKWARD | ||
} COREWEBVIEW2_FIND_DIRECTION; | ||
/// Interface defining the find configuration. | ||
/// This interface provides the necessary methods and properties to configure a find operation. | ||
[uuid(4A6ED732-DF08-4449-8949-3632A4DEBFCD), object, pointer_default(unique)] | ||
interface ICoreWebView2FindConfiguration : IUnknown { | ||
/// Gets the find term used for the find operation. | ||
/// \return The find term. | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[propget] HRESULT FindTerm([out, retval] LPWSTR* value); | ||
/// Sets the find term to be used for the find operation. | ||
/// \param[in] value The find term. | ||
[propput] HRESULT FindTerm([in] LPCWSTR value); | ||
/// Gets the direction of the find operation (forward or backward). | ||
/// \return The find direction. | ||
[propget] HRESULT FindDirection([out, retval] COREWEBVIEW2_FIND_DIRECTION* value); | ||
/// Sets the direction for the find operation. | ||
/// \param[in] value The find direction. | ||
[propput] HRESULT FindDirection([in] COREWEBVIEW2_FIND_DIRECTION value); | ||
/// Determines if the find operation is case sensitive. | ||
/// \return TRUE if the find is case sensitive, FALSE otherwise. | ||
[propget] HRESULT IsCaseSensitive([out, retval] BOOL* value); | ||
/// Sets whether the find operation should be case sensitive. | ||
/// \param[in] value TRUE to make the find case sensitive, FALSE otherwise. | ||
[propput] HRESULT IsCaseSensitive([in] BOOL value); | ||
/// Determines if only whole words should be matched during the find operation. | ||
/// \return TRUE if only whole words should be matched, FALSE otherwise. | ||
[propget] HRESULT ShouldMatchWord([out, retval] BOOL* value); | ||
/// Sets whether to only match whole words during the find operation. | ||
[propput] HRESULT ShouldMatchWord([in] BOOL value); | ||
/// Gets the state of whether all matches are highlighted. | ||
/// \return TRUE if all matches are highlighted, FALSE otherwise. | ||
[propget] HRESULT ShouldHighlightAllMatches([out, retval] BOOL* value); | ||
/// Sets the state to either highlight all matches or not. | ||
[propput] HRESULT ShouldHighlightAllMatches([in] BOOL value); | ||
/// Determines if the currently active match is highlighted. | ||
/// \return TRUE if the active match is highlighted, FALSE otherwise. | ||
[propget] HRESULT ShouldHighlightActiveMatch([out, retval] BOOL* value); | ||
/// Sets whether to highlight the currently active match. | ||
[propput] HRESULT ShouldHighlightActiveMatch([in] BOOL value); | ||
/// Checks if a custom user interface is desired by end developer. | ||
/// If TRUE, the default Find bar is not displayed. | ||
/// \return TRUE if using a custom UI, FALSE if using the default. | ||
[propget] HRESULT UseCustomUI([out, retval] BOOL* value); | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// Sets whether to use a custom UI for the Find operation. | ||
[propput] HRESULT UseCustomUI([in] BOOL value); | ||
/// Gets the index of the currently active match. | ||
/// If there's no active find session but an attempt is made to change the active match index: | ||
/// The function might crash if the global_match_id isn't found in the map. | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// It will clear any active match highlighting if there's a previously active frame. | ||
/// It will either select a new active match or return an error through the callback if the frame associated with the match isn't valid. | ||
/// \return The active match index. | ||
[propget] HRESULT ActiveMatchIndex([out, retval] LONG* value); | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// Sets the index for the active match. | ||
[propput] HRESULT ActiveMatchIndex([in] LONG value); | ||
/// Gets the total count of matches found in the current document based on the last find criteria. | ||
/// \return The total count of matches. | ||
[propget] HRESULT MatchesCount([out, retval] LONG* value); | ||
/** | ||
* Passes the current highlighting settings to the underlying Mojo. | ||
* | ||
* This function retrieves the current text highlighting settings set by the user | ||
* or the default system and ensures that they are used during any subsequent text | ||
* find or highlight operations. This includes settings related to highlighting | ||
* all matches, the active match, and any custom UI preferences. | ||
* | ||
* Users should call this function after changing any highlight settings to ensure | ||
* that they are applied properly in the system. | ||
*/ | ||
HRESULT PassHighlightSettings(); | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
/// Handles the event that's fired when the match count changes. | ||
[uuid(623EFBFB-A19E-43C4-B309-D578511D24AB), object, pointer_default(unique)] | ||
interface ICoreWebView2FindMatchCountChangedEventHandler : IUnknown { | ||
/// Provides the event args when the match count changes. | ||
HRESULT Invoke(LONG matchesCount); | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
/// Handles the event that's fired when the active match index changes. | ||
[uuid(623EFBF9-A19E-43C4-B309-D578511D24A9), object, pointer_default(unique)] | ||
interface ICoreWebView2FindActiveMatchIndexChangedEventHandler : IUnknown { | ||
/// Provides the event args when the active match index changes. | ||
/// \param sender The sender of this event, representing the current instance of ICoreWebView2Find. | ||
/// \param args The event args that contain the new active match index. | ||
HRESULT Invoke( | ||
[in] ICoreWebView2* sender, | ||
[in] ICoreWebView2FindActiveMatchIndexChangedEventArgs* args); | ||
} | ||
/// Handles the event that's fired when the find operation completes. | ||
[uuid(2604789D-9553-4246-8E21-B9C74EFAD04F), object, pointer_default(unique)] | ||
interface ICoreWebView2FindOperationCompletedHandler : IUnknown { | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// Provides the event args when the find operation completes. | ||
HRESULT Invoke(HRESULT value, LONG activeMatchIndex, LONG matchesCount); | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
// Interface defining the find configuration. | ||
[uuid(4A6ED732-DF08-4449-8949-3632A4DEBFCD), object, pointer_default(unique)] | ||
interface ICoreWebView2FindConfiguration : IUnknown { | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Gets or sets the find term used for the find operation. | ||
[propget] HRESULT FindTerm([out, retval] LPWSTR* value); | ||
[propput] HRESULT FindTerm([in] LPCWSTR value); | ||
// Gets or sets the direction of the find operation (forward or backward). | ||
[propget] HRESULT FindDirection([out, retval] COREWEBVIEW2_FIND_DIRECTION* value); | ||
[propput] HRESULT FindDirection([in] COREWEBVIEW2_FIND_DIRECTION value); | ||
// Gets or sets whether the find operation is case sensitive. | ||
[propget] HRESULT IsCaseSensitive([out, retval] BOOL* value); | ||
[propput] HRESULT IsCaseSensitive([in] BOOL value); | ||
// Gets or sets whether to only match whole words during the find operation. | ||
[propget] HRESULT ShouldMatchWord([out, retval] BOOL* value); | ||
[propput] HRESULT ShouldMatchWord([in] BOOL value); | ||
// Gets the state of whether all matches are highlighted. | ||
// \return TRUE if all matches are highlighted, FALSE otherwise. | ||
[propget] HRESULT ShouldHighlightAllMatches([out, retval] BOOL* value); | ||
// Sets the state to either highlight all matches or not. | ||
[propput] HRESULT ShouldHighlightAllMatches([in] BOOL value); | ||
// Determines if the currently active match is highlighted. | ||
// \return TRUE if the active match is highlighted, FALSE otherwise. | ||
[propget] HRESULT ShouldHighlightActiveMatch([out, retval] BOOL* value); | ||
// Sets whether to highlight the currently active match. | ||
[propput] HRESULT ShouldHighlightActiveMatch([in] BOOL value); | ||
// Checks if a custom user interface is desired by end developer. | ||
// If TRUE, the default Find bar is not displayed. | ||
// \return TRUE if using a custom UI, FALSE if using the default. | ||
[propget] HRESULT UseCustomUI([out, retval] BOOL* value); | ||
// Sets whether to use a custom UI for the Find operation. | ||
[propput] HRESULT UseCustomUI([in] BOOL value); | ||
// Gets the index of the currently active match. | ||
// If there's no active find session but an attempt is made to change the active match index: | ||
// The function might crash if the global_match_id isn't found in the map. | ||
// It will clear any active match highlighting if there's a previously active frame. | ||
// It will either select a new active match or return an error through the callback if the frame associated with the match isn't valid. | ||
// \return The active match index. | ||
[propget] HRESULT ActiveMatchIndex([out, retval] LONG* value); | ||
// Sets the index for the active match. | ||
[propput] HRESULT ActiveMatchIndex([in] LONG value); | ||
// Gets the total count of matches found in the current document based on the last find criteria. | ||
// \return The total count of matches. | ||
[propget] HRESULT MatchesCount([out, retval] LONG* value); | ||
/** | ||
* Passes the current highlighting settings to the underlying Mojo. | ||
* | ||
* This function retrieves the current text highlighting settings set by the user | ||
* or the default system and ensures that they are used during any subsequent text | ||
* find or highlight operations. This includes settings related to highlighting | ||
* all matches, the active match, and any custom UI preferences. | ||
* | ||
* Users should call this function after changing any highlight settings to ensure | ||
* that they are applied properly in the system. | ||
*/ | ||
HRESULT PassHighlightSettings(); | ||
} | ||
// Interface providing methods and properties for finding and navigating through text in the web view. | ||
[uuid(7C49A8AA-2A17-4846-8207-21D1520AABC0), object, pointer_default(unique)] | ||
interface ICoreWebView2Find : IUnknown { | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Initiates a find using the specified configuration. | ||
HRESULT StartFind([in] ICoreWebView2FindConfiguration* configuration, | ||
ICoreWebView2FindOperationCompletedHandler* handler); | ||
// Navigates to the next match in the document. | ||
HRESULT FindNext(); | ||
// Navigates to the previous match in the document. | ||
HRESULT FindPrevious(); | ||
// Stops the current 'Find' operation and hides the Find bar. | ||
HRESULT StopFind(); | ||
// Registers an event handler for the FindCompleted event. | ||
// This event is raised when a find operation completes, either by finding all matches, navigating to a match, or by being stopped. | ||
// \param eventHandler The event handler to be added. | ||
// \return A token representing the added event handler. This token can be used to unregister the event handler. | ||
HRESULT add_FindOperationCompleted( | ||
[in] ICoreWebView2FindOperationCompletedHandler* eventHandler, | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[out] EventRegistrationToken* token); | ||
// Unregisters an event handler from the FindCompleted event. | ||
// \param token The token of the event handler to be removed, obtained during the registration of the event handler. | ||
HRESULT remove_FindOperationCompleted([in] EventRegistrationToken token); | ||
// Registers an event handler for the MatchCountChanged event. | ||
// This event is raised when the total count of matches in the document changes due to a new find operation or changes in the document. | ||
// \param eventHandler The event handler to be added. | ||
// \return A token representing the added event handler. This token can be used to unregister the event handler. | ||
HRESULT add_MatchCountChanged( | ||
maxwellmyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[in] ICoreWebView2FindMatchCountChangedEventHandler* eventHandler, | ||
[out] EventRegistrationToken* token); | ||
// Unregisters an event handler from the MatchCountChanged event. | ||
// \param token The token of the event handler to be removed, obtained during the registration of the event handler. | ||
HRESULT remove_MatchCountChanged([in] EventRegistrationToken token); | ||
// Registers an event handler for the ActiveMatchIndexChanged event. | ||
// This event is raised when the index of the currently active match changes. | ||
// This can happen when the user navigates to a different match or when the active match is changed programmatically. | ||
// \param eventHandler The event handler to be added. | ||
// \return A token representing the added event handler. This token can be used to unregister the event handler. | ||
HRESULT add_ActiveMatchIndexChanged( | ||
[in] ICoreWebView2FindActiveMatchIndexChangedEventHandler* eventHandler, | ||
[out] EventRegistrationToken* token); | ||
// Unregisters an event handler from the ActiveMatchIndexChanged event. | ||
// \param token The token of the event handler to be removed, obtained during the registration of the event handler. | ||
HRESULT remove_ActiveMatchIndexChanged([in] EventRegistrationToken token); | ||
} | ||
``` | ||
|
||
# Appendix | ||
|
||
This API specification focuses on providing developers with the necessary information to integrate text finding and navigation functionalities into WebView2 applications. | ||
It emphasizes the usage of interfaces such as `ICoreWebView2Find` and `ICoreWebView2FindConfiguration` to perform find operations effectively. | ||
For more detailed implementation notes and examples, developers can refer to the WebView2 documentation and sample code provided by Microsoft. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.