{"id":219,"date":"2025-02-14T11:32:06","date_gmt":"2025-02-14T03:32:06","guid":{"rendered":"http:\/\/www.winradar.com\/?p=219"},"modified":"2025-02-14T11:34:06","modified_gmt":"2025-02-14T03:34:06","slug":"cef%e5%bc%80%e5%8f%91%e5%ad%a6%e4%b9%a0-windows%e5%b9%b3%e5%8f%b0%e7%ae%80%e6%98%93%e7%9a%84cef%e6%b5%8f%e8%a7%88%e5%99%a8%ef%bc%8c%e6%94%af%e6%8c%81%e4%b8%8b%e8%bd%bd%e7%ae%a1%e7%90%86%e5%92%8c","status":"publish","type":"post","link":"http:\/\/www.winradar.com\/?p=219","title":{"rendered":"Cef\u5f00\u53d1\u5b66\u4e60 &#8211; Windows\u5e73\u53f0\u7b80\u6613\u7684Cef\u6d4f\u89c8\u5668\uff0c\u652f\u6301\u4e0b\u8f7d\u7ba1\u7406\u548c\u591a\u6807\u7b7e\u7ba1\u7406"},"content":{"rendered":"<h1>Cef\u5f00\u53d1\u5b66\u4e60 &#8211; Windows\u5e73\u53f0\u7b80\u6613\u7684Cef\u6d4f\u89c8\u5668\uff0c\u652f\u6301\u4e0b\u8f7d\u7ba1\u7406\u548c\u591a\u6807\u7b7e\u7ba1\u7406<\/h1>\n<p>PS\uff1a\u672c\u7cfb\u5217\u6587\u7ae0\u4e3b\u8981\u5b66\u4e60\u4ecb\u7ecdCef\u5f00\u53d1\u76f8\u5173\u7684\u5185\u5bb9\u3002<\/p>\n<h1>\u4e00\u3001\u6d4f\u89c8\u5668\u5185\u6838<\/h1>\n<p>\u672c\u7a0b\u5e8f\u4f7f\u7528\u7684Cef\u5f00\u53d1\u5185\u6838\u5e93\u7684\u7248\u672c\u4e3alibcef 3809\uff0c\u91cd\u65b0\u7f16\u8bd1\u7684\u540e\u76843809\u5e93\u652f\u6301MP4\u89c6\u9891\u64ad\u653e\u3002<\/p>\n<pre><code class=\"lang-cpp language-cpp cpp\">class ICefBrowserHandler\n{\npublic:\n    virtual void OnLoadEnd(\n        CefRefPtr\n&lt;CefBrowser&gt; browser,\n        CefRefPtr\n&lt;CefFrame&gt; frame,\n        int httpStatusCode){}\n\n    virtual void OnAfterCreated(CefRefPtr\n&lt;CefBrowser&gt; browser) { }\n\n    virtual bool OnBeforePopup(CefRefPtr\n&lt;CefBrowser&gt; browser,\n        CefRefPtr\n&lt;CefFrame&gt; frame,\n        const CefString&amp; target_url,\n        const CefString&amp; target_frame_name,\n        cef_window_open_disposition_t target_disposition,\n        bool user_gesture,\n        const CefPopupFeatures&amp; popupFeatures,\n        CefWindowInfo&amp; windowInfo,\n        CefRefPtr\n&lt;CefClient&gt;&amp; client,\n        CefBrowserSettings&amp; settings,\n        CefRefPtr\n&lt;CefDictionaryValue&gt;&amp; extra_info,\n        bool* no_javascript_access) { return true; }\n    \/\/\/\n    \/\/ Called when a frame's address has changed.\n    \/\/\/\n    \/*--cef()--*\/\n    virtual void OnAddressChange(CefRefPtr\n&lt;CefBrowser&gt; browser,\n        CefRefPtr\n&lt;CefFrame&gt; frame,\n        const CefString&amp; url) {}\n\n    \/\/\/\n    \/\/ Called when the page title changes.\n    \/\/\/\n    \/*--cef(optional_param=title)--*\/\n    virtual void OnTitleChange(CefRefPtr\n&lt;CefBrowser&gt; browser,\n        const CefString&amp; title) {}\n\n    \/\/\/\n    \/\/ Called when the page icon changes.\n    \/\/\/\n    \/*--cef(optional_param=icon_urls)--*\/\n    virtual void OnFaviconURLChange(CefRefPtr\n&lt;CefBrowser&gt; browser,\n        const std::vector\n&lt;CefString&gt;&amp; icon_urls) {}\n\n    \/\/\/\n    \/\/ Called when web content in the page has toggled fullscreen mode. If\n    \/\/ |fullscreen| is true the content will automatically be sized to fill the\n    \/\/ browser content area. If |fullscreen| is false the content will\n    \/\/ automatically return to its original size and position. The client is\n    \/\/ responsible for resizing the browser if desired.\n    \/\/\/\n    \/*--cef()--*\/\n    virtual void OnFullscreenModeChange(CefRefPtr\n&lt;CefBrowser&gt; browser,\n        bool fullscreen) {}\n\n    \/\/\/\n    \/\/ Called when the browser is about to display a tooltip. |text| contains the\n    \/\/ text that will be displayed in the tooltip. To handle the display of the\n    \/\/ tooltip yourself return true. Otherwise, you can optionally modify |text|\n    \/\/ and then return false to allow the browser to display the tooltip.\n    \/\/ When window rendering is disabled the application is responsible for\n    \/\/ drawing tooltips and the return value is ignored.\n    \/\/\/\n    \/*--cef(optional_param=text)--*\/\n    virtual bool OnTooltip(CefRefPtr\n&lt;CefBrowser&gt; browser,\n        CefString&amp; text) { return false; }\n\n    \/\/\/\n    \/\/ Called when the browser receives a status message. |value| contains the\n    \/\/ text that will be displayed in the status message.\n    \/\/\/\n    \/*--cef(optional_param=value)--*\/\n    virtual void OnStatusMessage(CefRefPtr\n&lt;CefBrowser&gt; browser,\n        const CefString&amp; value) {}\n\n    \/\/\/\n    \/\/ Called to display a console message. Return true to stop the message from\n    \/\/ being output to the console.\n    \/\/\/\n    \/*--cef(optional_param=message,optional_param=source)--*\/\n    virtual bool OnConsoleMessage(CefRefPtr\n&lt;CefBrowser&gt; browser,\n        const CefString&amp; message,\n        const CefString&amp; source,\n        int line) { return false; }\n};\n<\/code><\/pre>\n<h1>\u4e8c\u3001\u6d4f\u89c8\u5668UI<\/h1>\n<p>\u672c\u7a0b\u5e8f\u4f7f\u7528\u5f00\u6e90\u7684Duilib\u5e93\u4f5c\u4e3a\u6d4f\u89c8\u5668\u7684UI\u5f00\u53d1\u5e93\uff0c\u5b9e\u73b0\u4e86\u6d4f\u89c8\u5668\u591a\u7a97\u53e3\u3001\u591a\u6807\u7b7e\u3001\u4e0b\u8f7d\u7ba1\u7406\u7684\u5404\u4e2a\u6a21\u5757\u3002\n1\u3001Cef\u6d4f\u89c8\u5668\u63a7\u4ef6<\/p>\n<pre><code class=\"lang-cpp language-cpp cpp\">class CCefBrowserUI : public CControlUI, public IMessageFilterUI\n{\npublic:\n    CCefBrowserUI();\n    ~CCefBrowserUI();\n\npublic:\n    LPCTSTR GetClass() const;\n    LPVOID GetInterface(LPCTSTR pstrName);\n\npublic:\n    void SetPos(RECT rc, bool bNeedInvalidate = true);\n    void SetVisible(bool bVisible \/* = true *\/);\n    void SetInternVisible(bool bVisible);\n\n    void DoEvent(TEventUI&amp; event);\n}\n<\/code><\/pre>\n<p>2\u3001\u591a\u6807\u7b7e\u7ba1\u7406<\/p>\n<pre><code class=\"lang-cpp language-cpp cpp\">class CBrowserTabBar : public CContainerUI\n{\npublic:\n    CBrowserTabBar();\n    ~CBrowserTabBar();\n\npublic:\n    LPCTSTR GetClass() const;\n    LPVOID GetInterface(LPCTSTR pstrName);\n\n    void SetPos(RECT rc, bool bNeedInvalidate = true);\n\npublic:\n    bool Add(CControlUI* pControl);\n    bool AddAt(CControlUI* pControl, int iIndex);\n    void Invalidate();\n\n    void SetStartTab(int nStart);\n    void SelectTab(CBrowserTab *pTab);\n    void SelectTab(int nIndex);\n    void CloseTab(CBrowserTab *pTab, BOOL bPrevSelected = TRUE);\n    int GetTabCount();\n    int GetVisibleTabCount();\n    CBrowserTab* GetTab(int nIndex);\n    int GetTabIndex(CBrowserTab *pTab);\n    CBrowserTab* GetPrevTab(CBrowserTab *pTab);\n    CBrowserTab* GetNextTab(CBrowserTab *pTab);\n\nprivate:\n    void UpdatePostPaint(CBrowserTab *pTab);\n\nprivate:\n    int m_nStartTab;\n    int m_nSelectedTab;\n};<\/code><\/pre>\n<h1>\u4e09\u3001\u6d4f\u89c8\u5668\u6f14\u793a<\/h1>\n<p><a href=\"https:\/\/live.csdn.net\/v\/embed\/216646\">https:\/\/live.csdn.net\/v\/embed\/216646<\/a><\/p>\n<h1>\u56db\u3001\u6d4f\u89c8\u5668\u4f8b\u5b50\u4e0b\u8f7d<\/h1>\n<p><a href=\"https:\/\/download.csdn.net\/download\/duiplus\/85658091\">Cef\u6d4f\u89c8\u5668\u4e0b\u8f7d<\/a><\/p>\n<h1>\u603b\u7ed3<\/h1>\n<p>\u968f\u7740\u684c\u9762\u8f6f\u4ef6\u5f00\u53d1\u7684\u79fb\u52a8\u5316\u548cWeb\u5316\uff0c\u96c6\u6210Cef\u540e\uff0c\u6781\u5927\u7684\u63d0\u9ad8\u4e86\u524d\u7aef\u590d\u6742\u9879\u76ee\u7684\u5f00\u53d1\u6548\u7387\uff0c\u6838\u5fc3\u4ee3\u7801\u4e00\u6b21\u7f16\u8bd1\uff0c\u591a\u5e73\u53f0\u5171\u4eab\u4f7f\u7528\uff01<\/p>","protected":false},"excerpt":{"rendered":"<p>Cef\u5f00\u53d1\u5b66\u4e60 &#8211; Windows\u5e73\u53f0\u7b80\u6613\u7684Cef\u6d4f\u89c8\u5668\uff0c\u652f\u6301\u4e0b\u8f7d\u7ba1\u7406\u548c\u591a\u6807\u7b7e\u7ba1\u7406 PS\uff1a\u672c\u7cfb\u5217\u6587\u7ae0\u4e3b\u8981\u5b66\u4e60\u4ecb\u7ecdCef\u5f00\u53d1\u76f8\u5173\u7684\u5185\u5bb9\u3002 \u4e00\u3001\u6d4f\u89c8\u5668\u5185\u6838 \u672c\u7a0b\u5e8f\u4f7f\u7528\u7684Cef\u5f00\u53d1\u5185\u6838\u5e93\u7684\u7248\u672c\u4e3alibcef 3809\uff0c\u91cd\u65b0\u7f16\u8bd1\u7684\u540e\u76843809\u5e93\u652f\u6301MP<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,5],"tags":[10],"class_list":["post-219","post","type-post","status-publish","format-standard","hentry","category-cef","category-opensource","tag-cef","comments-off"],"_links":{"self":[{"href":"http:\/\/www.winradar.com\/index.php?rest_route=\/wp\/v2\/posts\/219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.winradar.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.winradar.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.winradar.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.winradar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=219"}],"version-history":[{"count":4,"href":"http:\/\/www.winradar.com\/index.php?rest_route=\/wp\/v2\/posts\/219\/revisions"}],"predecessor-version":[{"id":223,"href":"http:\/\/www.winradar.com\/index.php?rest_route=\/wp\/v2\/posts\/219\/revisions\/223"}],"wp:attachment":[{"href":"http:\/\/www.winradar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.winradar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=219"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.winradar.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}