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

ICoreWebView2Controller

COM
IID4d00c0d1-9434-4eb6-8078-8697a560334f継承元IUnknown自前メソッド開始 vtbl3

メソッド 23

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

vtbl 3 HRESULT get_IsVisible(BOOL* isVisible)
isVisibleBOOL*outWebView2 が表示されているかどうかを受け取る BOOL へのポインタである。
vtbl 4 HRESULT put_IsVisible(BOOL isVisible)
isVisibleBOOLinWebView2 を表示するか非表示にするかを指定する。
vtbl 5 HRESULT get_Bounds(RECT* bounds)
boundsRECT*outWebView2 が描画される親ウィンドウ内の境界矩形を受け取る RECT へのポインタである。
vtbl 6 HRESULT put_Bounds(RECT bounds)
boundsRECTinWebView2 を描画する親ウィンドウ内の境界矩形を指定する。
vtbl 7 HRESULT get_ZoomFactor(DOUBLE* zoomFactor)
zoomFactorDOUBLE*out現在のズーム倍率を受け取る DOUBLE へのポインタである。1.0 が等倍を表す。
vtbl 8 HRESULT put_ZoomFactor(DOUBLE zoomFactor)
zoomFactorDOUBLEinWebView2 のズーム倍率を指定する。1.0 が等倍を表す。
vtbl 9 HRESULT add_ZoomFactorChanged(ICoreWebView2ZoomFactorChangedEventHandler* eventHandler, EventRegistrationToken* token)
eventHandlerICoreWebView2ZoomFactorChangedEventHandler*inズーム倍率変更イベントを受け取る ICoreWebView2ZoomFactorChangedEventHandler へのポインタである。
tokenEventRegistrationToken*out登録解除に使用するイベント登録トークンを受け取る EventRegistrationToken へのポインタである。
vtbl 10 HRESULT remove_ZoomFactorChanged(EventRegistrationToken token)
tokenEventRegistrationTokeninadd_ZoomFactorChanged で取得した、登録解除対象のイベント登録トークンを指定する。
vtbl 11 HRESULT SetBoundsAndZoomFactor(RECT bounds, DOUBLE zoomFactor)
boundsRECTinWebView2 を描画する親ウィンドウ内の境界矩形を指定する。
zoomFactorDOUBLEin同時に適用するズーム倍率を指定する。1.0 が等倍を表す。
vtbl 12 HRESULT MoveFocus(COREWEBVIEW2_MOVE_FOCUS_REASON reason)
reasonCOREWEBVIEW2_MOVE_FOCUS_REASONinフォーカスを移動させる理由(タブ操作の方向、プログラムによる移動など)を示す COREWEBVIEW2_MOVE_FOCUS_REASON 値を指定する。
vtbl 13 HRESULT add_MoveFocusRequested(ICoreWebView2MoveFocusRequestedEventHandler* eventHandler, EventRegistrationToken* token)
eventHandlerICoreWebView2MoveFocusRequestedEventHandler*inフォーカス移動要求イベントを受け取る ICoreWebView2MoveFocusRequestedEventHandler へのポインタである。
tokenEventRegistrationToken*out登録解除に使用するイベント登録トークンを受け取る EventRegistrationToken へのポインタである。
vtbl 14 HRESULT remove_MoveFocusRequested(EventRegistrationToken token)
tokenEventRegistrationTokeninadd_MoveFocusRequested で取得した、登録解除対象のイベント登録トークンを指定する。
vtbl 15 HRESULT add_GotFocus(ICoreWebView2FocusChangedEventHandler* eventHandler, EventRegistrationToken* token)
eventHandlerICoreWebView2FocusChangedEventHandler*inWebView2 がフォーカスを得たことを受け取る ICoreWebView2FocusChangedEventHandler へのポインタである。
tokenEventRegistrationToken*out登録解除に使用するイベント登録トークンを受け取る EventRegistrationToken へのポインタである。
vtbl 16 HRESULT remove_GotFocus(EventRegistrationToken token)
tokenEventRegistrationTokeninadd_GotFocus で取得した、登録解除対象のイベント登録トークンを指定する。
vtbl 17 HRESULT add_LostFocus(ICoreWebView2FocusChangedEventHandler* eventHandler, EventRegistrationToken* token)
eventHandlerICoreWebView2FocusChangedEventHandler*inWebView2 がフォーカスを失ったことを受け取る ICoreWebView2FocusChangedEventHandler へのポインタである。
tokenEventRegistrationToken*out登録解除に使用するイベント登録トークンを受け取る EventRegistrationToken へのポインタである。
vtbl 18 HRESULT remove_LostFocus(EventRegistrationToken token)
tokenEventRegistrationTokeninadd_LostFocus で取得した、登録解除対象のイベント登録トークンを指定する。
vtbl 19 HRESULT add_AcceleratorKeyPressed(ICoreWebView2AcceleratorKeyPressedEventHandler* eventHandler, EventRegistrationToken* token)
eventHandlerICoreWebView2AcceleratorKeyPressedEventHandler*inアクセラレータキー押下イベントを受け取る ICoreWebView2AcceleratorKeyPressedEventHandler へのポインタである。
tokenEventRegistrationToken*out登録解除に使用するイベント登録トークンを受け取る EventRegistrationToken へのポインタである。
vtbl 20 HRESULT remove_AcceleratorKeyPressed(EventRegistrationToken token)
tokenEventRegistrationTokeninadd_AcceleratorKeyPressed で取得した、登録解除対象のイベント登録トークンを指定する。
vtbl 21 HRESULT get_ParentWindow(HWND* parentWindow)
parentWindowHWND*outWebView2 をホストしている親ウィンドウのハンドル(HWND)を受け取るポインタである。
vtbl 22 HRESULT put_ParentWindow(HWND parentWindow)
parentWindowHWNDinWebView2 をホストする親ウィンドウのハンドル(HWND)を指定する。
vtbl 23 HRESULT NotifyParentWindowPositionChanged( void)
voidin引数はない。
vtbl 24 HRESULT Close( void)
voidin引数はない。
vtbl 25 HRESULT get_CoreWebView2(ICoreWebView2** coreWebView2)
coreWebView2ICoreWebView2**outこのコントローラに関連付けられた ICoreWebView2 を受け取るポインタである。

HSP用 COM定義

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

出力引数:
#define global IID_ICoreWebView2Controller "{4D00C0D1-9434-4EB6-8078-8697A560334F}"
#usecom global ICoreWebView2Controller IID_ICoreWebView2Controller "{}"
#comfunc global ICoreWebView2Controller_get_IsVisible                      3 var
#comfunc global ICoreWebView2Controller_put_IsVisible                      4 int
#comfunc global ICoreWebView2Controller_get_Bounds                         5 var
#comfunc global ICoreWebView2Controller_put_Bounds                         6 int
#comfunc global ICoreWebView2Controller_get_ZoomFactor                     7 var
#comfunc global ICoreWebView2Controller_put_ZoomFactor                     8 double
#comfunc global ICoreWebView2Controller_add_ZoomFactorChanged              9 sptr,var
#comfunc global ICoreWebView2Controller_remove_ZoomFactorChanged           10 int
#comfunc global ICoreWebView2Controller_SetBoundsAndZoomFactor             11 int,double
#comfunc global ICoreWebView2Controller_MoveFocus                          12 int
#comfunc global ICoreWebView2Controller_add_MoveFocusRequested             13 sptr,var
#comfunc global ICoreWebView2Controller_remove_MoveFocusRequested          14 int
#comfunc global ICoreWebView2Controller_add_GotFocus                       15 sptr,var
#comfunc global ICoreWebView2Controller_remove_GotFocus                    16 int
#comfunc global ICoreWebView2Controller_add_LostFocus                      17 sptr,var
#comfunc global ICoreWebView2Controller_remove_LostFocus                   18 int
#comfunc global ICoreWebView2Controller_add_AcceleratorKeyPressed          19 sptr,var
#comfunc global ICoreWebView2Controller_remove_AcceleratorKeyPressed       20 int
#comfunc global ICoreWebView2Controller_get_ParentWindow                   21 sptr
#comfunc global ICoreWebView2Controller_put_ParentWindow                   22 sptr
#comfunc global ICoreWebView2Controller_NotifyParentWindowPositionChanged  23 int
#comfunc global ICoreWebView2Controller_Close                              24 int
#comfunc global ICoreWebView2Controller_get_CoreWebView2                   25 sptr
; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。
; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。
; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。
; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。

関連項目

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