ICoreWebView2ContextMenuRequestedEventArgs
COMメソッド 8
vtbl = vtable インデックス(0始まり)。HSP等からインデックス指定でCOMメソッドを呼ぶ際に使用します。0〜2 は IUnknown。
vtbl 3 HRESULT get_MenuItems(ICoreWebView2ContextMenuItemCollection** value)
| value | ICoreWebView2ContextMenuItemCollection** | out | コンテキストメニューを構成するメニュー項目のコレクションを保持する ICoreWebView2ContextMenuItemCollection を受け取るポインタである。 |
vtbl 4 HRESULT get_ContextMenuTarget(ICoreWebView2ContextMenuTarget** value)
| value | ICoreWebView2ContextMenuTarget** | out | コンテキストメニューが要求された対象(リンク、画像、選択範囲など)の情報を保持する ICoreWebView2ContextMenuTarget を受け取るポインタである。 |
vtbl 5 HRESULT get_Location(POINT* value)
| value | POINT* | out | コンテキストメニューを表示すべき位置(WebView2 クライアント座標)を受け取る POINT へのポインタである。 |
vtbl 6 HRESULT put_SelectedCommandId(INT value)
| value | INT | in | アプリ側のカスタム UI で選択されたメニュー項目のコマンド ID を指定する。 |
vtbl 7 HRESULT get_SelectedCommandId(INT* value)
| value | INT* | out | 選択されたメニュー項目のコマンド ID を受け取る INT へのポインタである。 |
vtbl 8 HRESULT put_Handled(BOOL value)
| value | BOOL | in | コンテキストメニューの表示をアプリ側で処理したかどうかを指定する。TRUE で WebView2 の既定メニュー表示を抑制する。 |
vtbl 9 HRESULT get_Handled(BOOL* value)
| value | BOOL* | out | イベントがアプリ側で処理済みかどうかを受け取る BOOL へのポインタである。 |
vtbl 10 HRESULT GetDeferral(ICoreWebView2Deferral** deferral)
| deferral | ICoreWebView2Deferral** | out | イベントの応答を非同期に延期するための ICoreWebView2Deferral オブジェクトを受け取るポインタである。 |
HSP用 COM定義
#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。WebView2 のインターフェースは環境/ローダ経由で取得するため #usecom 末尾は "{}"。
出力引数:
#define global IID_ICoreWebView2ContextMenuRequestedEventArgs "{A1D309EE-C03F-11EB-8529-0242AC130003}" #usecom global ICoreWebView2ContextMenuRequestedEventArgs IID_ICoreWebView2ContextMenuRequestedEventArgs "{}" #comfunc global ICoreWebView2ContextMenuRequestedEventArgs_get_MenuItems 3 sptr #comfunc global ICoreWebView2ContextMenuRequestedEventArgs_get_ContextMenuTarget 4 sptr #comfunc global ICoreWebView2ContextMenuRequestedEventArgs_get_Location 5 var #comfunc global ICoreWebView2ContextMenuRequestedEventArgs_put_SelectedCommandId 6 int #comfunc global ICoreWebView2ContextMenuRequestedEventArgs_get_SelectedCommandId 7 var #comfunc global ICoreWebView2ContextMenuRequestedEventArgs_put_Handled 8 int #comfunc global ICoreWebView2ContextMenuRequestedEventArgs_get_Handled 9 var #comfunc global ICoreWebView2ContextMenuRequestedEventArgs_GetDeferral 10 sptr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。#define global IID_ICoreWebView2ContextMenuRequestedEventArgs "{A1D309EE-C03F-11EB-8529-0242AC130003}" #usecom global ICoreWebView2ContextMenuRequestedEventArgs IID_ICoreWebView2ContextMenuRequestedEventArgs "{}" #comfunc global ICoreWebView2ContextMenuRequestedEventArgs_get_MenuItems 3 sptr #comfunc global ICoreWebView2ContextMenuRequestedEventArgs_get_ContextMenuTarget 4 sptr #comfunc global ICoreWebView2ContextMenuRequestedEventArgs_get_Location 5 sptr #comfunc global ICoreWebView2ContextMenuRequestedEventArgs_put_SelectedCommandId 6 int #comfunc global ICoreWebView2ContextMenuRequestedEventArgs_get_SelectedCommandId 7 sptr #comfunc global ICoreWebView2ContextMenuRequestedEventArgs_put_Handled 8 int #comfunc global ICoreWebView2ContextMenuRequestedEventArgs_get_Handled 9 sptr #comfunc global ICoreWebView2ContextMenuRequestedEventArgs_GetDeferral 10 sptr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。