Example #1
0
        //----

        public MyCefBrowser(IWindowControl parentControl,
                            int x, int y, int w, int h, string initUrl, bool isOsr)
        {
            this.currentUrl = initUrl;
            //create cef browser view handler
            this.parentControl = parentControl;
            this.topForm       = (IWindowForm)parentControl.GetTopLevelControl();
            //ui process ***
            this.managedCallback = new MyCefCallback(this.MxCallBack);
            //for specific browser
            if (this.IsOsr = isOsr)
            {
                this.myCefBrowser = Cef3Binder.MyCefCreateMyWebBrowserOSR(managedCallback);
                Cef3Binder.MyCefSetupBrowserHwndOSR(myCefBrowser, parentControl.GetHandle(), x, y, w, h, initUrl, IntPtr.Zero);
            }
            else
            {
                this.myCefBrowser = Cef3Binder.MyCefCreateMyWebBrowser(managedCallback);
                Cef3Binder.MyCefSetupBrowserHwnd(myCefBrowser, parentControl.GetHandle(), x, y, w, h, initUrl, IntPtr.Zero);
            }

            Cef3Binder.MyCefEnableKeyIntercept(myCefBrowser, 1);
            //register mycef browser
            RegisterCefWbControl(this);
        }