ICoreWebView2ContextMenuItem
COMメソッド 13
vtbl = vtable インデックス(0始まり)。HSP等からインデックス指定でCOMメソッドを呼ぶ際に使用します。0〜2 は IUnknown。
vtbl 3 HRESULT get_Name(LPWSTR* value)
| value | LPWSTR* | out | コンテキストメニュー項目の名前(識別子)を受け取る文字列ポインタである。 |
vtbl 4 HRESULT get_Label(LPWSTR* value)
| value | LPWSTR* | out | コンテキストメニュー項目に表示されるラベル文字列を受け取るポインタである。 |
vtbl 5 HRESULT get_CommandId(INT* value)
| value | INT* | out | コンテキストメニュー項目のコマンド ID を受け取る INT へのポインタである。 |
vtbl 6 HRESULT get_ShortcutKeyDescription(LPWSTR* value)
| value | LPWSTR* | out | メニュー項目に表示するショートカットキーの説明文字列を受け取るポインタである。 |
vtbl 7 HRESULT get_Icon(IStream** value)
| value | IStream** | out | メニュー項目のアイコン画像データを保持する IStream を受け取るポインタである。 |
vtbl 8 HRESULT get_Kind(COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND* value)
| value | COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND* | out | メニュー項目の種類(コマンド、チェックボックス、セパレータ、サブメニューなど)を示す COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND 値を受け取るポインタである。 |
vtbl 9 HRESULT put_IsEnabled(BOOL value)
| value | BOOL | in | メニュー項目を有効にするかどうかを指定する。 |
vtbl 10 HRESULT get_IsEnabled(BOOL* value)
| value | BOOL* | out | メニュー項目が有効かどうかを受け取る BOOL へのポインタである。 |
vtbl 11 HRESULT put_IsChecked(BOOL value)
| value | BOOL | in | メニュー項目をチェック状態にするかどうかを指定する。 |
vtbl 12 HRESULT get_IsChecked(BOOL* value)
| value | BOOL* | out | メニュー項目がチェック状態かどうかを受け取る BOOL へのポインタである。 |
vtbl 13 HRESULT get_Children(ICoreWebView2ContextMenuItemCollection** value)
| value | ICoreWebView2ContextMenuItemCollection** | out | サブメニュー項目のコレクションを保持する ICoreWebView2ContextMenuItemCollection を受け取るポインタである。 |
vtbl 14 HRESULT add_CustomItemSelected(ICoreWebView2CustomItemSelectedEventHandler* eventHandler, EventRegistrationToken* token)
| eventHandler | ICoreWebView2CustomItemSelectedEventHandler* | in | カスタムメニュー項目の選択イベントを受け取る ICoreWebView2CustomItemSelectedEventHandler へのポインタである。 |
| token | EventRegistrationToken* | out | 登録解除に使用するイベント登録トークンを受け取る EventRegistrationToken へのポインタである。 |
vtbl 15 HRESULT remove_CustomItemSelected(EventRegistrationToken token)
| token | EventRegistrationToken | in | add_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 指定が可能。#define global IID_ICoreWebView2ContextMenuItem "{7AED49E3-A93F-497A-811C-749C6B6B6C65}" #usecom global ICoreWebView2ContextMenuItem IID_ICoreWebView2ContextMenuItem "{}" #comfunc global ICoreWebView2ContextMenuItem_get_Name 3 sptr #comfunc global ICoreWebView2ContextMenuItem_get_Label 4 sptr #comfunc global ICoreWebView2ContextMenuItem_get_CommandId 5 sptr #comfunc global ICoreWebView2ContextMenuItem_get_ShortcutKeyDescription 6 sptr #comfunc global ICoreWebView2ContextMenuItem_get_Icon 7 sptr #comfunc global ICoreWebView2ContextMenuItem_get_Kind 8 sptr #comfunc global ICoreWebView2ContextMenuItem_put_IsEnabled 9 int #comfunc global ICoreWebView2ContextMenuItem_get_IsEnabled 10 sptr #comfunc global ICoreWebView2ContextMenuItem_put_IsChecked 11 int #comfunc global ICoreWebView2ContextMenuItem_get_IsChecked 12 sptr #comfunc global ICoreWebView2ContextMenuItem_get_Children 13 sptr #comfunc global ICoreWebView2ContextMenuItem_add_CustomItemSelected 14 sptr,sptr #comfunc global ICoreWebView2ContextMenuItem_remove_CustomItemSelected 15 int ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。