- Code: Select all
#include <Windows.h>
#include <include/cef_app.h>
#include <include/cef_client.h>
#include <include/wrapper/cef_helpers.h>
class Handler : public CefClient {
IMPLEMENT_REFCOUNTING(Handler);
};
class App : public CefApp, public CefBrowserProcessHandler {
public:
CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() override {
return this;
}
void OnContextInitialized() override {
CEF_REQUIRE_UI_THREAD();
CefRefPtr<Handler> handler(new Handler);
CefWindowInfo wndInfo;
wndInfo.SetAsPopup(NULL, "Hello world");
CefBrowserSettings settings;
CefBrowserHost::CreateBrowser(wndInfo, handler, "http://bitbucket.org", settings, nullptr, nullptr);
}
public:
IMPLEMENT_REFCOUNTING(App);
};
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) {
CefEnableHighDPISupport();
CefMainArgs args{ hInstance };
CefRefPtr<App> app{ new App };
int ec = CefExecuteProcess(args, app, nullptr);
if (ec >= 0) {
return ec;
}
CefSettings settings;
CefInitialize(args, settings, app.get(), nullptr);
CefRunMessageLoop();
CefShutdown();
return 0;
}
Project folder contains all files from cefclient
- Code: Select all
08.04.2020 12:21 2 133 001 cef.pak
08.04.2020 12:21 654 037 cef_100_percent.pak
08.04.2020 12:21 808 292 cef_200_percent.pak
08.04.2020 12:21 1 772 827 cef_extensions.pak
08.04.2020 12:21 1 110 016 chrome_elf.dll
08.04.2020 12:21 4 346 120 d3dcompiler_47.dll
08.04.2020 12:21 7 015 266 devtools_resources.pak
08.04.2020 12:21 10 505 952 icudtl.dat
08.04.2020 12:21 158 316 032 libcef.dll
08.04.2020 12:21 391 168 libEGL.dll
08.04.2020 12:21 10 552 832 libGLESv2.dll
08.04.2020 12:44 <DIR> locales
09.04.2020 18:14 613 247 main.obj
09.04.2020 18:14 3 948 032 Project1.exe
08.04.2020 12:21 606 640 snapshot_blob.bin
08.04.2020 12:49 <DIR> swiftshader
08.04.2020 12:21 923 968 v8_context_snapshot.bin
09.04.2020 18:14 519 168 vc142.idb
09.04.2020 18:14 847 872 vc142.pdb
why can i get a blank page?
PS1 Windows 10, VS2019CE, CEF Version: 80.1.15+g7b802c9+chromium-80.0.3987.163
PS2 cesimple normal worked