コード例 #1
0
ファイル: Window.cs プロジェクト: zhh007/Chromely
        /// <summary>
        /// The on realized.
        /// </summary>
        /// <param name="hwnd">
        /// The hwnd.
        /// </param>
        /// <param name="width">
        /// The width.
        /// </param>
        /// <param name="height">
        /// The height.
        /// </param>
        /// <exception cref="NotSupportedException">
        /// Exception returned for MacOS not supported.
        /// </exception>
        protected override void OnCreate(IntPtr hwnd, int width, int height)
        {
            var windowInfo = CefWindowInfo.Create();

            windowInfo.SetAsChild(hwnd, new CefRectangle(0, 0, mHostConfig.HostWidth, mHostConfig.HostHeight));
            mBrowser.Create(windowInfo);
        }
コード例 #2
0
ファイル: Window.cs プロジェクト: won21kr/Chromely
        protected override void OnRealized(object sender, EventArgs e)
        {
            var windowInfo = CefWindowInfo.Create();

            switch (CefRuntime.Platform)
            {
            case CefRuntimePlatform.Windows:
                var parentHandle = HostXid;
                windowInfo.SetAsChild(parentHandle, new CefRectangle(0, 0, m_hostConfig.HostWidth, m_hostConfig.HostHeight));
                break;

            case CefRuntimePlatform.Linux:
                windowInfo.SetAsChild(HostXid, new CefRectangle(0, 0, m_hostConfig.HostWidth, m_hostConfig.HostHeight));
                break;

            case CefRuntimePlatform.MacOSX:
            default:
                throw new NotSupportedException();
            }

            m_core.Create(windowInfo);
        }