
程序代码:
PROCEDURE load
this.api = CREATEOBJECT("MY_WEBVIEW2_API", this)
this.eve = CREATEOBJECT("MY_WEBVIEW_EVENT", this, this.api)
BINDEVENT(this.hWnd, MY_WEBVIEW_MESSAGE, this.eve, "onMessage")
BINDEVENT(this.hWnd, MY_WEBFORM_MESSAGE, this, "onMessage")
this.wv2 = WebView_Create(this.hWnd, this.hWnd, MY_WEBVIEW_MESSAGE,;
0, 28, this.width, this.height - 28, STRCONV(userDataFolder+0h00,5))
this.api.wv2 = this.wv2
this.hWebView = this.api.getWebViewHwnd()
ENDPROC
PROCEDURE Resize
apiMoveWindow(this.hWebView, 0, this.tools_bar.height, this.Width, this.Height-this.tools_bar.height, 1)
this.api.Refresh()
ENDPROC
this.api
WebView2 api 类对象
this.eve
WebView2 事件类对象
this.wv2
WebView2 类对象指针
this.hWebView 窗口句柄
apiMoveWindow 在实例表单的 Resize 调用,由父窗口的 Resize 改变其窗口大小而触发
[此贴子已经被作者于2026-1-19 16:42编辑过]