写的网页没有window.webkit.messagehandlers 怎么回调

发布于2022-01-13 16:26:44
2个回答
admin
网友回答2022-01-13
可以参考 webkit tool 里的 WinLauncher 工程: standardPreferences->setAcceleratedCompositingEnabled(TRUE); HRESULT hr = WebKitCreateInstance(CLSID_WebView, 0, IID_IWebView, reinterpret_cast(&gWebView)); if (FAILED(hr)) goto exit; hr = gWebView->QueryInterface(IID_IWebViewPrivate, reinterpret_cast(&gWebViewPrivate)); if (FAILED(hr)) goto exit; gWebHost = new WinLauncherWebHost(); gWebHost->AddRef(); hr = gWebView->setFrameLoadDelegate(gWebHost); if (FAILED(hr)) goto exit; gPrintDelegate = new PrintWebUIDelegate; gPrintDelegate->AddRef(); hr = gWebView->setUIDelegate(gPrintDelegate); if (FAILED (hr)) goto exit; hr = gWebView->setHostWindow(reinterpret_cast(hMainWnd)); if (FAILED(hr)) goto exit; hr = gWebView->initWithFrame(clientRect, 0, 0); if (FAILED(hr)) goto exit; IWebFrame* frame; hr = gWebView->mainFrame(&frame); if (FAILED(hr)) goto exit;**>**>
admin
网友回答2022-01-13
期待看到有用的回答!

回到
顶部