WebView2 日本語リファレンス
WebView2インターフェース › ICoreWebView2Frame2

ICoreWebView2Frame2

COM
IID7a6a5834-d185-4dbf-b63f-4a9bc43107d4継承元ICoreWebView2Frame自前メソッド開始 vtbl11

メソッド 13

vtbl = vtable インデックス(0始まり)。HSP等からインデックス指定でCOMメソッドを呼ぶ際に使用します。0〜2 は IUnknown。

vtbl 11 HRESULT add_NavigationStarting(ICoreWebView2FrameNavigationStartingEventHandler* eventHandler, EventRegistrationToken* token)
eventHandlerICoreWebView2FrameNavigationStartingEventHandler*inフレームのナビゲーションが開始される直前に呼び出されるイベントハンドラーへのポインタである。
tokenEventRegistrationToken*out登録したハンドラーを後で解除するために使用する登録トークンを受け取るポインタである。
vtbl 12 HRESULT remove_NavigationStarting(EventRegistrationToken token)
tokenEventRegistrationTokeninadd_NavigationStarting で取得した登録トークンを指定し、対応するイベントハンドラーを解除する。
vtbl 13 HRESULT add_ContentLoading(ICoreWebView2FrameContentLoadingEventHandler* eventHandler, EventRegistrationToken* token)
eventHandlerICoreWebView2FrameContentLoadingEventHandler*inフレームのコンテンツの読み込みが始まったときに呼び出されるイベントハンドラーへのポインタである。
tokenEventRegistrationToken*out登録したハンドラーを後で解除するために使用する登録トークンを受け取るポインタである。
vtbl 14 HRESULT remove_ContentLoading(EventRegistrationToken token)
tokenEventRegistrationTokeninadd_ContentLoading で取得した登録トークンを指定し、対応するイベントハンドラーを解除する。
vtbl 15 HRESULT add_NavigationCompleted(ICoreWebView2FrameNavigationCompletedEventHandler* eventHandler, EventRegistrationToken* token)
eventHandlerICoreWebView2FrameNavigationCompletedEventHandler*inフレームのナビゲーションが完了したときに呼び出されるイベントハンドラーへのポインタである。
tokenEventRegistrationToken*out登録したハンドラーを後で解除するために使用する登録トークンを受け取るポインタである。
vtbl 16 HRESULT remove_NavigationCompleted(EventRegistrationToken token)
tokenEventRegistrationTokeninadd_NavigationCompleted で取得した登録トークンを指定し、対応するイベントハンドラーを解除する。
vtbl 17 HRESULT add_DOMContentLoaded(ICoreWebView2FrameDOMContentLoadedEventHandler* eventHandler, EventRegistrationToken* token)
eventHandlerICoreWebView2FrameDOMContentLoadedEventHandler*inフレームの DOMContentLoaded(DOM の解析完了)が発生したときに呼び出されるイベントハンドラーへのポインタである。
tokenEventRegistrationToken*out登録したハンドラーを後で解除するために使用する登録トークンを受け取るポインタである。
vtbl 18 HRESULT remove_DOMContentLoaded(EventRegistrationToken token)
tokenEventRegistrationTokeninadd_DOMContentLoaded で取得した登録トークンを指定し、対応するイベントハンドラーを解除する。
vtbl 19 HRESULT ExecuteScript(LPWSTR javaScript, ICoreWebView2ExecuteScriptCompletedHandler* handler)
javaScriptLPWSTRinフレーム内で実行する JavaScript コードの文字列を指定する。
handlerICoreWebView2ExecuteScriptCompletedHandler*inスクリプトの実行が完了したときに結果とともに呼び出される完了ハンドラーへのポインタである。
vtbl 20 HRESULT PostWebMessageAsJson(LPWSTR webMessageAsJson)
webMessageAsJsonLPWSTRinフレームの Web コンテンツへ送信するメッセージを JSON 形式で表した文字列を指定する。
vtbl 21 HRESULT PostWebMessageAsString(LPWSTR webMessageAsString)
webMessageAsStringLPWSTRinフレームの Web コンテンツへ文字列として送信するメッセージを指定する。
vtbl 22 HRESULT add_WebMessageReceived(ICoreWebView2FrameWebMessageReceivedEventHandler* handler, EventRegistrationToken* token)
handlerICoreWebView2FrameWebMessageReceivedEventHandler*inフレームの Web コンテンツからメッセージを受信したときに呼び出されるイベントハンドラーへのポインタである。
tokenEventRegistrationToken*out登録したハンドラーを後で解除するために使用する登録トークンを受け取るポインタである。
vtbl 23 HRESULT remove_WebMessageReceived(EventRegistrationToken token)
tokenEventRegistrationTokeninadd_WebMessageReceived で取得した登録トークンを指定し、対応するイベントハンドラーを解除する。

HSP用 COM定義

#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。WebView2 のインターフェースは環境/ローダ経由で取得するため #usecom 末尾は "{}"

出力引数:
#define global IID_ICoreWebView2Frame2 "{7A6A5834-D185-4DBF-B63F-4A9BC43107D4}"
#usecom global ICoreWebView2Frame2 IID_ICoreWebView2Frame2 "{}"
#comfunc global ICoreWebView2Frame2_add_NavigationStarting      11 sptr,var
#comfunc global ICoreWebView2Frame2_remove_NavigationStarting   12 int
#comfunc global ICoreWebView2Frame2_add_ContentLoading          13 sptr,var
#comfunc global ICoreWebView2Frame2_remove_ContentLoading       14 int
#comfunc global ICoreWebView2Frame2_add_NavigationCompleted     15 sptr,var
#comfunc global ICoreWebView2Frame2_remove_NavigationCompleted  16 int
#comfunc global ICoreWebView2Frame2_add_DOMContentLoaded        17 sptr,var
#comfunc global ICoreWebView2Frame2_remove_DOMContentLoaded     18 int
#comfunc global ICoreWebView2Frame2_ExecuteScript               19 wstr,sptr
#comfunc global ICoreWebView2Frame2_PostWebMessageAsJson        20 wstr
#comfunc global ICoreWebView2Frame2_PostWebMessageAsString      21 wstr
#comfunc global ICoreWebView2Frame2_add_WebMessageReceived      22 sptr,var
#comfunc global ICoreWebView2Frame2_remove_WebMessageReceived   23 int
; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。
; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。
; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。
; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。

関連項目

バージョン違い・関連インターフェース