Skip to content
Snippets Groups Projects
Commit 6565b411 authored by svornost's avatar svornost
Browse files

Set main window icon correctly

parent 88c0df7c
No related branches found
No related tags found
1 merge request!5145Add standalone host executable for FreeCities, with unlimited storage adapter
......@@ -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());
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment