ICoreWebView2Frame2
COMメソッド 13
vtbl = vtable インデックス(0始まり)。HSP等からインデックス指定でCOMメソッドを呼ぶ際に使用します。0〜2 は IUnknown。
vtbl 11 HRESULT add_NavigationStarting(ICoreWebView2FrameNavigationStartingEventHandler* eventHandler, EventRegistrationToken* token)
| eventHandler | ICoreWebView2FrameNavigationStartingEventHandler* | in | フレームのナビゲーションが開始される直前に呼び出されるイベントハンドラーへのポインタである。 |
| token | EventRegistrationToken* | out | 登録したハンドラーを後で解除するために使用する登録トークンを受け取るポインタである。 |
vtbl 12 HRESULT remove_NavigationStarting(EventRegistrationToken token)
| token | EventRegistrationToken | in | add_NavigationStarting で取得した登録トークンを指定し、対応するイベントハンドラーを解除する。 |
vtbl 13 HRESULT add_ContentLoading(ICoreWebView2FrameContentLoadingEventHandler* eventHandler, EventRegistrationToken* token)
| eventHandler | ICoreWebView2FrameContentLoadingEventHandler* | in | フレームのコンテンツの読み込みが始まったときに呼び出されるイベントハンドラーへのポインタである。 |
| token | EventRegistrationToken* | out | 登録したハンドラーを後で解除するために使用する登録トークンを受け取るポインタである。 |
vtbl 14 HRESULT remove_ContentLoading(EventRegistrationToken token)
| token | EventRegistrationToken | in | add_ContentLoading で取得した登録トークンを指定し、対応するイベントハンドラーを解除する。 |
vtbl 15 HRESULT add_NavigationCompleted(ICoreWebView2FrameNavigationCompletedEventHandler* eventHandler, EventRegistrationToken* token)
| eventHandler | ICoreWebView2FrameNavigationCompletedEventHandler* | in | フレームのナビゲーションが完了したときに呼び出されるイベントハンドラーへのポインタである。 |
| token | EventRegistrationToken* | out | 登録したハンドラーを後で解除するために使用する登録トークンを受け取るポインタである。 |
vtbl 16 HRESULT remove_NavigationCompleted(EventRegistrationToken token)
| token | EventRegistrationToken | in | add_NavigationCompleted で取得した登録トークンを指定し、対応するイベントハンドラーを解除する。 |
vtbl 17 HRESULT add_DOMContentLoaded(ICoreWebView2FrameDOMContentLoadedEventHandler* eventHandler, EventRegistrationToken* token)
| eventHandler | ICoreWebView2FrameDOMContentLoadedEventHandler* | in | フレームの DOMContentLoaded(DOM の解析完了)が発生したときに呼び出されるイベントハンドラーへのポインタである。 |
| token | EventRegistrationToken* | out | 登録したハンドラーを後で解除するために使用する登録トークンを受け取るポインタである。 |
vtbl 18 HRESULT remove_DOMContentLoaded(EventRegistrationToken token)
| token | EventRegistrationToken | in | add_DOMContentLoaded で取得した登録トークンを指定し、対応するイベントハンドラーを解除する。 |
vtbl 19 HRESULT ExecuteScript(LPWSTR javaScript, ICoreWebView2ExecuteScriptCompletedHandler* handler)
| javaScript | LPWSTR | in | フレーム内で実行する JavaScript コードの文字列を指定する。 |
| handler | ICoreWebView2ExecuteScriptCompletedHandler* | in | スクリプトの実行が完了したときに結果とともに呼び出される完了ハンドラーへのポインタである。 |
vtbl 20 HRESULT PostWebMessageAsJson(LPWSTR webMessageAsJson)
| webMessageAsJson | LPWSTR | in | フレームの Web コンテンツへ送信するメッセージを JSON 形式で表した文字列を指定する。 |
vtbl 21 HRESULT PostWebMessageAsString(LPWSTR webMessageAsString)
| webMessageAsString | LPWSTR | in | フレームの Web コンテンツへ文字列として送信するメッセージを指定する。 |
vtbl 22 HRESULT add_WebMessageReceived(ICoreWebView2FrameWebMessageReceivedEventHandler* handler, EventRegistrationToken* token)
| handler | ICoreWebView2FrameWebMessageReceivedEventHandler* | in | フレームの Web コンテンツからメッセージを受信したときに呼び出されるイベントハンドラーへのポインタである。 |
| token | EventRegistrationToken* | out | 登録したハンドラーを後で解除するために使用する登録トークンを受け取るポインタである。 |
vtbl 23 HRESULT remove_WebMessageReceived(EventRegistrationToken token)
| token | EventRegistrationToken | in | add_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 指定が可能。#define global IID_ICoreWebView2Frame2 "{7A6A5834-D185-4DBF-B63F-4A9BC43107D4}" #usecom global ICoreWebView2Frame2 IID_ICoreWebView2Frame2 "{}" #comfunc global ICoreWebView2Frame2_add_NavigationStarting 11 sptr,sptr #comfunc global ICoreWebView2Frame2_remove_NavigationStarting 12 int #comfunc global ICoreWebView2Frame2_add_ContentLoading 13 sptr,sptr #comfunc global ICoreWebView2Frame2_remove_ContentLoading 14 int #comfunc global ICoreWebView2Frame2_add_NavigationCompleted 15 sptr,sptr #comfunc global ICoreWebView2Frame2_remove_NavigationCompleted 16 int #comfunc global ICoreWebView2Frame2_add_DOMContentLoaded 17 sptr,sptr #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,sptr #comfunc global ICoreWebView2Frame2_remove_WebMessageReceived 23 int ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。