Skip to content

Commit

Permalink
くたばれ WebBrowser コントロール
Browse files Browse the repository at this point in the history
  • Loading branch information
Grabacr07 committed Jan 19, 2014
1 parent b8af628 commit ee70c58
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Grabacr07.KanColleViewer/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<setting name="UIContentHight" serializeAs="String">
<value>333</value>
</setting>
<setting name="FeatureBrowserEmulation" serializeAs="String">
<value>8000</value>
</setting>
</Grabacr07.KanColleViewer.Properties.Settings>
</applicationSettings>
</configuration>
1 change: 1 addition & 0 deletions Grabacr07.KanColleViewer/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ protected override void OnStartup(StartupEventArgs e)
this.DispatcherUnhandledException += (sender, args) => ReportException(sender, args.Exception);

DispatcherHelper.UIDispatcher = this.Dispatcher;
Helper.SetRegistryFeatureBrowserEmulation();
KanColleClient.Current.Proxy.Startup(AppSettings.Default.LocalProxyPort);
Settings.Load();

Expand Down
25 changes: 25 additions & 0 deletions Grabacr07.KanColleViewer/Model/Helper.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Microsoft.Win32;

namespace Grabacr07.KanColleViewer.Model
{
Expand Down Expand Up @@ -45,5 +47,28 @@ public static bool IsInDesignMode
{
get { return DesignerProperties.GetIsInDesignMode(new DependencyObject()); }
}


/// <summary>
/// HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
/// に WebBrowser コントロールの動作バージョンを設定します。
/// </summary>
public static void SetRegistryFeatureBrowserEmulation()
{
const string key = @"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION";

try
{
var valueName = Process.GetCurrentProcess().ProcessName + ".exe";
if (Registry.GetValue(key, valueName, null) == null)
{
Registry.SetValue(key, valueName, Properties.Settings.Default.FeatureBrowserEmulation, RegistryValueKind.DWord);
}
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
}
}
}
9 changes: 9 additions & 0 deletions Grabacr07.KanColleViewer/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Grabacr07.KanColleViewer/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@
<Setting Name="UIContentHight" Type="System.Double" Scope="Application">
<Value Profile="(Default)">333</Value>
</Setting>
<Setting Name="FeatureBrowserEmulation" Type="System.Int32" Scope="Application">
<Value Profile="(Default)">8000</Value>
</Setting>
</Settings>
</SettingsFile>

0 comments on commit ee70c58

Please sign in to comment.