以下是引用ykxby001在2025-1-6 16:21:21的发言:
必须是【顶层表单】,其他不行。
vfp的顶层表单有两层窗口
示例中:(在表单的load事件)
* 创建 WebView2
this.hWebView = WebView_Create(apiGetTopWindow(this.hWnd), this.hWnd, MY_WEBVIEW_MESSAGE, 0, 28, this.Width, this.Height-28)
如果不是顶层表单,试试将其中的 apiGetTopWindow(this.hWnd) 改为 this.hWnd