| 13 | using namespace Microsoft::WRL; |
| 14 | |
| 15 | FileComponent::FileComponent(AppWindow* appWindow) |
| 16 | : m_appWindow(appWindow), m_webView(appWindow->GetWebView()) |
| 17 | { |
| 18 | //! [DocumentTitleChanged] |
| 19 | // Register a handler for the DocumentTitleChanged event. |
| 20 | // This handler just announces the new title on the window's title bar. |
| 21 | CHECK_FAILURE(m_webView->add_DocumentTitleChanged( |
| 22 | Callback<ICoreWebView2DocumentTitleChangedEventHandler>( |
| 23 | [this](ICoreWebView2* sender, IUnknown* args) -> HRESULT { |
| 24 | wil::unique_cotaskmem_string title; |
| 25 | CHECK_FAILURE(sender->get_DocumentTitle(&title)); |
| 26 | m_appWindow->SetDocumentTitle(title.get()); |
| 27 | return S_OK; |
| 28 | }) |
| 29 | .Get(), |
| 30 | &m_documentTitleChangedToken)); |
| 31 | //! [DocumentTitleChanged] |
| 32 | } |
| 33 | |
| 34 | bool FileComponent::HandleWindowMessage( |
| 35 | HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT* result) |
nothing calls this directly
no test coverage detected