chrome: win: Fix app icon for default Chrome windows (fixes #3606)

This fixes the app icon for default Chrome windows such as DevTools
and Task Manager.

An ICON with value IDR_MAINFRAME (101) will be loaded from the main
executable is available. Otherwise, the default Chromium ICON will be
loaded from libcef.dll.
This commit is contained in:
Marshall Greenblatt
2023-11-20 19:35:05 -05:00
parent cf934a20a7
commit 3b652a9966
9 changed files with 97 additions and 15 deletions

View File

@@ -340,7 +340,7 @@ void RootWindowWin::CreateRootWindow(const CefBrowserSettings& settings,
// Load strings from the resource file.
const std::wstring& window_title = GetResourceString(IDS_APP_TITLE);
const std::wstring& window_class = GetResourceString(IDC_CEFCLIENT);
const std::wstring& window_class = GetResourceString(IDR_MAINFRAME);
const cef_color_t background_color = MainContext::Get()->GetBackgroundColor();
const HBRUSH background_brush = CreateSolidBrush(
@@ -446,10 +446,10 @@ void RootWindowWin::RegisterRootClass(HINSTANCE hInstance,
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_CEFCLIENT));
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDR_MAINFRAME));
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
wcex.hbrBackground = background_brush;
wcex.lpszMenuName = MAKEINTRESOURCE(IDC_CEFCLIENT);
wcex.lpszMenuName = MAKEINTRESOURCE(IDR_MAINFRAME);
wcex.lpszClassName = window_class.c_str();
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));