diff --git a/FCHost/fchost/fchost_handler_win.cc b/FCHost/fchost/fchost_handler_win.cc index d92b24b0e217e8abbf316da10564927f0672deca..6089e0bbf04d56ac2276f09d9501b9465737d6a5 100644 --- a/FCHost/fchost/fchost_handler_win.cc +++ b/FCHost/fchost/fchost_handler_win.cc @@ -8,9 +8,21 @@ #include <string> #include "include/cef_browser.h" +#include "resource.h" void FCHostHandler::PlatformTitleChange(CefRefPtr<CefBrowser> browser, const CefString& title) { CefWindowHandle hwnd = browser->GetHost()->GetWindowHandle(); + + static bool haveSetIcon = false; + if (!haveSetIcon) + { + HICON hicon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_FCHOST)); + SendMessage(hwnd, WM_SETICON, ICON_SMALL, reinterpret_cast<LPARAM>(hicon)); + SendMessage(hwnd, WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(hicon)); + DestroyIcon(hicon); + haveSetIcon = true; + } + SetWindowText(hwnd, std::wstring(title).c_str()); }