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

ICoreWebView2ContextMenuItem

COM
IID7aed49e3-a93f-497a-811c-749c6b6b6c65継承元IUnknown自前メソッド開始 vtbl3

メソッド 13

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

vtbl 3 HRESULT get_Name(LPWSTR* value)
valueLPWSTR*outコンテキストメニュー項目の名前(識別子)を受け取る文字列ポインタである。
vtbl 4 HRESULT get_Label(LPWSTR* value)
valueLPWSTR*outコンテキストメニュー項目に表示されるラベル文字列を受け取るポインタである。
vtbl 5 HRESULT get_CommandId(INT* value)
valueINT*outコンテキストメニュー項目のコマンド ID を受け取る INT へのポインタである。
vtbl 6 HRESULT get_ShortcutKeyDescription(LPWSTR* value)
valueLPWSTR*outメニュー項目に表示するショートカットキーの説明文字列を受け取るポインタである。
vtbl 7 HRESULT get_Icon(IStream** value)
valueIStream**outメニュー項目のアイコン画像データを保持する IStream を受け取るポインタである。
vtbl 8 HRESULT get_Kind(COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND* value)
valueCOREWEBVIEW2_CONTEXT_MENU_ITEM_KIND*outメニュー項目の種類(コマンド、チェックボックス、セパレータ、サブメニューなど)を示す COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND 値を受け取るポインタである。
vtbl 9 HRESULT put_IsEnabled(BOOL value)
valueBOOLinメニュー項目を有効にするかどうかを指定する。
vtbl 10 HRESULT get_IsEnabled(BOOL* value)
valueBOOL*outメニュー項目が有効かどうかを受け取る BOOL へのポインタである。
vtbl 11 HRESULT put_IsChecked(BOOL value)
valueBOOLinメニュー項目をチェック状態にするかどうかを指定する。
vtbl 12 HRESULT get_IsChecked(BOOL* value)
valueBOOL*outメニュー項目がチェック状態かどうかを受け取る BOOL へのポインタである。
vtbl 13 HRESULT get_Children(ICoreWebView2ContextMenuItemCollection** value)
valueICoreWebView2ContextMenuItemCollection**outサブメニュー項目のコレクションを保持する ICoreWebView2ContextMenuItemCollection を受け取るポインタである。
vtbl 14 HRESULT add_CustomItemSelected(ICoreWebView2CustomItemSelectedEventHandler* eventHandler, EventRegistrationToken* token)
eventHandlerICoreWebView2CustomItemSelectedEventHandler*inカスタムメニュー項目の選択イベントを受け取る ICoreWebView2CustomItemSelectedEventHandler へのポインタである。
tokenEventRegistrationToken*out登録解除に使用するイベント登録トークンを受け取る EventRegistrationToken へのポインタである。
vtbl 15 HRESULT remove_CustomItemSelected(EventRegistrationToken token)
tokenEventRegistrationTokeninadd_CustomItemSelected で取得した、登録解除対象のイベント登録トークンを指定する。

HSP用 COM定義

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

出力引数:
#define global IID_ICoreWebView2ContextMenuItem "{7AED49E3-A93F-497A-811C-749C6B6B6C65}"
#usecom global ICoreWebView2ContextMenuItem IID_ICoreWebView2ContextMenuItem "{}"
#comfunc global ICoreWebView2ContextMenuItem_get_Name                    3 var
#comfunc global ICoreWebView2ContextMenuItem_get_Label                   4 var
#comfunc global ICoreWebView2ContextMenuItem_get_CommandId               5 var
#comfunc global ICoreWebView2ContextMenuItem_get_ShortcutKeyDescription  6 var
#comfunc global ICoreWebView2ContextMenuItem_get_Icon                    7 sptr
#comfunc global ICoreWebView2ContextMenuItem_get_Kind                    8 var
#comfunc global ICoreWebView2ContextMenuItem_put_IsEnabled               9 int
#comfunc global ICoreWebView2ContextMenuItem_get_IsEnabled               10 var
#comfunc global ICoreWebView2ContextMenuItem_put_IsChecked               11 int
#comfunc global ICoreWebView2ContextMenuItem_get_IsChecked               12 var
#comfunc global ICoreWebView2ContextMenuItem_get_Children                13 sptr
#comfunc global ICoreWebView2ContextMenuItem_add_CustomItemSelected      14 sptr,var
#comfunc global ICoreWebView2ContextMenuItem_remove_CustomItemSelected   15 int
; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。
; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。
; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。
; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。