CEF3(Chromium Embedded Framework)
費了好大勁,終于把CEF3嵌入到了MFC視窗中,像WebView那樣的效果.
可是做好后發現一個很奇怪的問題,在Web中使用輸入法打字時,
輸入法提示跑到了Web視窗的左上角去了,如下圖

這是個很奇葩的問題,我試了一下CEF3官方的兩個Demo,發現他們也有同樣的問題.
然后,我又試了一下CEF1的官方Demo,和我之前用CEF1做的例子.
結果發現CEF1是正常的.
于是開始到網上,苦苦尋找答案. Baidu,Google 鍵盤都敲爛了
居然沒有發現一篇相關的文章!!!!!
于是到CSDN來尋找有相關經驗的前輩,求抱大腿.
誰能告訴我,這個坑怎么爬出來?
uj5u.com熱心網友回復:
沒玩過CEF嵌入MFC視窗。猜想是視窗屬性造成的?是否有某個視窗的大小為0?
你用spy++ 對比下CEF3 (有問題的)和CEF1(沒問題的)的視窗層次、大小等屬性
uj5u.com熱心網友回復:
看過,他們的視窗結構不一樣,CEF3的瀏覽器頁面視窗層下還多一個Static視窗
uj5u.com熱心網友回復:
不知道樓主解決了沒有,如果解決,可否告知解決方案?uj5u.com熱心網友回復:
這個bug樓主解決了沒有?uj5u.com熱心網友回復:
http://blog.csdn.net/sunve_163/article/details/49994487uj5u.com熱心網友回復:
我也是CEF3嵌入MFC視窗,沒發現這現象uj5u.com熱心網友回復:
SetCaretPosThe SetCaretPos function moves the caret to the specified coordinates. If the window that owns the caret was created with the CS_OWNDC class style, then the specified coordinates are subject to the mapping mode of the device context associated with that window.
BOOL SetCaretPos(
int X, // horizontal position
int Y // vertical position
);
Parameters
X
Specifies the new x-coordinate of the caret.
Y
Specifies the new y-coordinate of the caret.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, callGetLastError.
Remarks
SetCaretPos moves the caret whether or not the caret is hidden.
The system provides one caret per queue. A window should create a caret only when it has the keyboard focus or is active. The window should destroy the caret before losing the keyboard focus or becoming inactive. A window can set the caret position only if it owns the caret.
QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winuser.h.
Import Library: Use user32.lib.
See Also
Carets Overview, Caret Functions, GetCaretPos, HideCaret, ShowCaret
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/102561.html
標籤:HTML/XML
