首先,本文所有 代码已经提交到github,需要的可以直接从github获取:https://github.com/starts2000/CefSharp,希望可以帮助到有需要的朋友们。

CEF 简介

CEF is a BSD-licensed open source project founded by Marshall Greenblatt in 2008 and based on the Google Chromium project. Unlike the Chromium project itself, which focuses mainly on Google Chrome application development, CEF focuses on facilitating embedded browser use cases in third-party applications. CEF insulates the user from the underlying Chromium and Blink code complexity by offering production-quality stable APIs, release branches tracking specific Chromium releases, and binary distributions. Most features in CEF have default implementations that provide rich functionality while requiring little or no integration work from the user. There are currently over 100 million installed instances of CEF around the world embedded in products from a wide range of companies and industries. A partial list of companies and products using CEF is available on the CEF Wikipedia page. Some use cases for CEF include:

  • Embedding an HTML5-compliant Web browser control in an existing native application.

  • Creating a light-weight native “shell” application that hosts a user interface developed primarily using Web technologies.

  • Rendering Web content “off-screen” in applications that have their own custom drawing frameworks.

  • Acting as a host for automated testing of existing Web properties and applications.

CEF supports a wide range of programming languages and operating systems and can be easily integrated into both new and existing applications. It was designed from the ground up with both performance and ease of use in mind. The base framework includes C and C++ programming interfaces exposed via native libraries that insulate the host application from Chromium and Blink implementation details. It provides close integration between the browser and the host application including support for custom plugins, protocols, JavaScript objects and JavaScript extensions. The host application can optionally control resource loading, navigation, context menus, printing and more, while taking advantage of the same performance and HTML5 technologies available in the Google Chrome Web browser.
Numerous individuals and organizations contribute time and resources to support CEF development, but more involvement from the community is always welcome. This includes support for both the core CEF project and external projects that integrate CEF with additional programming languages and frameworks (see the "External Projects" section below). If you are interested in donating time to help with CEF development please see the "Helping Out" section below. If you are interested in donating money to support general CEF development and infrastructure efforts please visit the CEF Donations page.

CEF 的 .NET 开源项目主要有下面三个:

  1. CefSharp:https://github.com/chillitom/CefSharp

  2. cefglue:https://bitbucket.org/xilium/xilium.cefglue

  3. chromiumfx:https://bitbucket.org/chromiumfx/chromiumfx

CEF osr IME BUG 历史

CefSharp 和 cefglue 都使用 C++/CLI  对 cef API 进行封装,都提供了 cef 的 Winform 和 WPF 控件,而 chromiumfx 使用 P/Invoke 对 cef API 进行封装,只提供了cef Winform 控件。CefSharp 和 cefglue 的  cef WPF 控件都使用 cef 的 osr ( off screen  render)方式进行渲染,由于 osr 模式一直存在 IME BUG,所以 CefSharp 和 cefglue 的 WPF 控件也存在。

CEF osr IME bug 在 2012-11-22 就有人提出:https://bitbucket.org/chromiumembedded/cef/issues/798/out-of-focus-while-entering-ime,但是直到2016年底才解决https://bitbucket.org/chromiumembedded/cef/issues/1675/inline-ime-support-nstextinput-protocol-in,真是等的黄花菜都凉了。然而, CefSharp 和 cefglue 更是没能跟上 CEF 的脚步,这个 BUG 直到现在也没有解决,所有相关的 issue,回答都是建议在 WPF 中使用 Host WinForm 控件的方式使用 CEF。

CEF osr IME bug:

最近通过参考 cef 的 osr 示例的源码,通过移植和修改,终于实现了 CefSharp WPF 控件的 IME 输入,在这里分享给大家。

主要是在 CefSharp.Core 项目中增加了对 IME 消息及 CEF IME 相关的处理,还有就是 WPF 的 ChromiumWebBrowser 控件的相关代码修改。

相关文章:

  • 基于CefSharp构建基于Chromium的应用程序

  • 使用 CefSharp 在 C# App 中嵌入 Chrome 浏览器

原文地址:http://www.cnblogs.com/Starts_2000/p/cefharp-wpf-osr-ime.html


.NET社区新闻,深度好文,微信中搜索dotNET跨平台或扫描二维码关注

解决 CefSharp WPF控件不能使用输入法输入中文的问题(代码已提交到 github)相关推荐

  1. WPF控件textBox多行输入设置

    将 TextWrapping 属性设置为 Wrap 会导致输入的文本在到达 TextBox 控件的边缘时换至新行,必要时会自动扩展 TextBox 控件以便为新行留出空间. 将 AcceptsRetu ...

  2. Github 开源:使用控制器操作 WinForm/WPF 控件( Sheng.Winform.Controls.Controller)

    利用午休时间继续把过去写的一些代码翻出来说一说,文章可能写的比较简略,但是我会努力把核心意思表达清楚,具体代码可直接访问 Github 获取. Github 地址:https://github.com ...

  3. [转] 使用模板自定义 WPF 控件

      [转] 使用模板自定义 WPF 控件                                                                                 ...

  4. WPF开发人员必读:WPF控件测试台

    介绍 WpfControlTestbench帮助您为您的控件或您想要调查其行为的任何控件编写快速复杂的测试窗口.只需十几行XAML即可创建以下Window内容: 它在左下角显示你要测试的控件,在Win ...

  5. 日志查看器:显示日志记录信息的快速WPF控件

    对于长时间运行的后台任务,用户了解当前执行的步骤很有帮助.LogViewer可以安全地多线程收集此信息,并将其显示为可滚动文本.LogViewer允许后台线程在不使用任何WPF代码的情况下写入格式化文 ...

  6. [转载]WPF控件拖动

    这篇博文总结下WPF中的拖动,文章内容主要包括: 1.拖动窗口 2.拖动控件 Using Visual Studio 2.1thumb控件 2.2Drag.Drop(不连续,没有中间动画) 2.3拖动 ...

  7. DevExpress v15.1:WPF控件升级(四)

    2019独角兽企业重金招聘Python工程师标准>>> <下载最新版DevExpress WPF Controls v15.1.5> WPF编辑器 在Token编辑器中的 ...

  8. wpf控件设计时支持(2)

    原文:wpf控件设计时支持(2) 这篇介绍在wpf设计时集合项属性添加项的定义和自定义控件右键菜单的方法 集合项属性设计时支持 1.为集合属性设计器识别具体项类型 wpf设计器允许定义集合项的类型,如 ...

  9. wpf控件开发基础(1)

    从现在开始,我将尝试写有关wpf控件开发相关的知识,把文章这对我来说很难,所以这个系列的文章在时间跨度上可能会拖的比较长.我希望我介绍是比较详细的,而不仅仅是一个简单的控件开发流程.我是一个真正的We ...

最新文章

  1. python掌握程度怎么判断-Python数据分析路上,温故而知新
  2. iOS 获取app进程被杀死事件applicationWillTerminate
  3. 套接字没有连接并且没有提供地址_网络是怎样连接的 -- web服务器接到请求后将会做什么...
  4. matlab 工业相机 曝光时间_Matlab CCD工业相机采集图像问题 - 信息科学 - 小木虫 - 学术 科研 互动社区...
  5. 单板机 单片机 c语言,单板机 单片机 个人计算机有什么区别吗
  6. MySQL作为Kubernetes服务,可从WildFly Pod访问
  7. c# 声明类的时候初始化类_使用C#初始化的列表声明
  8. Linux 系统应用编程——标准I/O
  9. CPU8085 8086名字的由来
  10. python中分支结构包括哪些_python中的分支结构
  11. 全美杰出的技术MBA专业
  12. Spring Boot 使用 Dom4j XStream 操作 Xml
  13. 【经典案例】Python详解设计模式:策略模式
  14. 解决fiexd和transform一起用导致的失效问题
  15. 计算机word设置信纸,word怎么设置信纸格式
  16. 云服务器哪家最好,如何选择云服务器
  17. 单链表基本操作的实现——前插法与后插法创建单链表
  18. 项目管理5阶段|一位高级项目经理的4年项目经验分享
  19. docker安装kafka镜像
  20. 在线Base64编码 = 图片

热门文章

  1. uva-10305-水题-拓扑排序
  2. Android学习笔记(三)
  3. 本地开发时连接后台数据库时出现的错误,附自救方法
  4. 浮点型数据的输出格式
  5. S5PC100基于I2C子系统的lm75驱动流程图
  6. 通过openpctv简单学习opkg安装与生成包的一些过程
  7. phpmyadmin 安装 配置
  8. SVN客户端--TortoiseSVN使用说明
  9. ASP.NET Core启动地址配置方法及优先级顺序 | .NET 6 版本
  10. 设计模式:面向对象的设计原则下(ISP、DIP、KISS、YAGNI、DRY、LOD)