Example #1
0
        public unsafe void InitAsChild(IntPtr handle, System.Drawing.Rectangle rect)
        {
            cef_window_info_t *pinfo = WindowInfo.FixedPtr;

            pinfo->parent_window = handle;
            pinfo->x             = rect.Left;
            pinfo->y             = rect.Top;
            pinfo->width         = rect.Width;
            pinfo->height        = rect.Height;

            CefWin.WriteDebugLine("Creating browser " + CefWin.ApplicationElapsed);

            Browser          = CefBrowser.CreateBrowserSync(WindowInfo, Client, Url, Settings);
            MainFrame        = Browser.GetMainFrame();
            BrowserHost      = Browser.GetHost();
            hostWindowHandle = BrowserHost.GetWindowHandle();

            CefWin.WriteDebugLine("Creating browser OK doc:" + Browser.HasDocument + " id:" + Browser.Identifier + ":" + MainFrame.Identifier + " " + CefWin.ApplicationElapsed);
            CefWin.WriteDebugLine("send msgfrombrowser");
            MainFrame.SendProcessMessage(cef_process_id_t.PID_RENDERER, "msgfrombrowser");

            //do not call here, document is not ready!
            //MainFrame.ExecuteJavaScript("console.log('hello CefLite')");

            //ShowDevTools();
        }