Set title bar icon for CEF window.

This commit is contained in:
WrinklyNinja
2014-07-12 16:33:42 +01:00
parent 7014132664
commit 43776889b6
3 changed files with 41 additions and 1 deletions
+8
View File
@@ -23,6 +23,7 @@
*/
#include "handler.h"
#include "resource.h"
#include <include/cef_app.h>
#include <include/cef_runnable.h>
@@ -85,6 +86,13 @@ namespace loot {
void LootHandler::OnAfterCreated(CefRefPtr<CefBrowser> browser) {
assert(CefCurrentlyOn(TID_UI));
// Set the title bar icon.
HWND hWnd = browser->GetHost()->GetWindowHandle();
HANDLE hIcon = LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(MAINICON), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE);
HANDLE hIconSm = LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(MAINICON), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE);
SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)hIconSm);
// Add to the list of existing browsers.
browser_list_.push_back(browser);
}
+32
View File
@@ -0,0 +1,32 @@
/* LOOT
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and
Fallout: New Vegas.
Copyright (C) 2014 WrinklyNinja
This file is part of LOOT.
LOOT is free software: you can redistribute
it and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
LOOT is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with LOOT. If not, see
<http://www.gnu.org/licenses/>.
*/
#ifndef __LOOT_GUI_RESOURCE__
#define __LOOT_GUI_RESOURCE__
#include <windows.h>
#define MAINICON 101
#endif
+1 -1
View File
@@ -1,4 +1,4 @@
#include <windows.h>
#include "gui/resource.h"
1 VERSIONINFO
FILEVERSION 0,6,0,0
PRODUCTVERSION 0,6,0,0