From d8d87d3f1046cf7f4d7fd6f8540251513f57c7c2 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sat, 5 Jan 2019 18:58:29 +0100 Subject: [PATCH] Update launcher --- src/launcher/html_frame.cpp | 12 +++++---- src/launcher/html_frame.hpp | 2 +- src/resources/main.html | 54 +++++++++++++++++++++++++------------ 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/src/launcher/html_frame.cpp b/src/launcher/html_frame.cpp index db45462..f64ce90 100644 --- a/src/launcher/html_frame.cpp +++ b/src/launcher/html_frame.cpp @@ -19,7 +19,8 @@ html_frame::html_frame() : in_place_frame_(this), in_place_site_(this), ui_handl throw std::runtime_error("Unable to initialize the OLE library"); } - this->emulate_browser(); + set_browser_feature("FEATURE_BROWSER_EMULATION", 11000); + set_browser_feature("FEATURE_GPU_RENDERING", 1); } html_frame::~html_frame() @@ -153,16 +154,17 @@ void html_frame::initialize_browser() this->resize(rect.right, rect.bottom); } -void html_frame::emulate_browser() +void html_frame::set_browser_feature(const std::string& feature, DWORD value) { utils::nt::module self; + std::string registry_path = R"(SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\)" + feature; HKEY key = nullptr; if (RegOpenKeyExA( - HKEY_CURRENT_USER, R"(SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION)", 0, - KEY_ALL_ACCESS, &key) != ERROR_SUCCESS) return; + HKEY_CURRENT_USER, registry_path.data(), 0, + KEY_ALL_ACCESS, &key) != ERROR_SUCCESS) + return; - DWORD value = 11001; const auto name = self.get_name(); RegSetValueExA(key, name.data(), 0, REG_DWORD, reinterpret_cast(&value), sizeof(value)); diff --git a/src/launcher/html_frame.hpp b/src/launcher/html_frame.hpp index 6ca3a18..fcb2cc8 100644 --- a/src/launcher/html_frame.hpp +++ b/src/launcher/html_frame.hpp @@ -59,7 +59,7 @@ private: void create_browser(); void initialize_browser(); - static void emulate_browser(); + static void set_browser_feature(const std::string& feature, DWORD value); static void object_deleter(IUnknown* object); }; diff --git a/src/resources/main.html b/src/resources/main.html index bd88f2f..873ce6e 100644 --- a/src/resources/main.html +++ b/src/resources/main.html @@ -3,11 +3,16 @@ - Open-IW5
-
- + Singleplayer +
-
- + Multiplayer +