您好,登錄后才能下訂單哦!
這篇文章將為大家詳細講解有關如何解決 CefSharp WPF控件不能使用輸入法輸入中文的問題,文章內容質量較高,因此小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關知識有一定的了解。
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 開源項目主要有下面三個:
CefSharp:https://github.com/chillitom/CefSharp
cefglue:https://bitbucket.org/xilium/xilium.cefglue
chromiumfx:https://bitbucket.org/chromiumfx/chromiumfx
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 WPF控件不能使用輸入法輸入中文的問題就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。