using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Microsoft.Win32;
namespace 简体中文美式键盘
{
// Token: 0x02000002 RID: 2
public
class Form1 : Form
{
// Token: 0x06000001 RID: 1 RVA: 0x00002050 File
Offset
: 0x00000250
public
Form1()
{
this
.InitializeComponent();
this
.Text
=
"Windows 10 1903 添加简体中文美式键盘 By lmwuxia"
;
}
// Token: 0x06000002 RID: 2 RVA: 0x0000206C File
Offset
: 0x0000026C
private
void ButtonAddInPut_Click(object sender, EventArgs e)
{
RegistryKey currentUser = Registry.CurrentUser;
RegistryKey registryKey = currentUser.OpenSubKey(
"Keyboard Layout\\Substitutes"
, true);
registryKey.SetValue(
"00000804"
,
"00000409"
);
registryKey.Close();
registryKey = currentUser.OpenSubKey(
"Control Panel\\International\\User Profile"
, true);
registryKey.SetValue(
"InputMethodOverride"
,
"0804:00000409"
);
registryKey.Close();
registryKey = currentUser.OpenSubKey(
"Control Panel\\International\\User Profile\\zh-Hans-CN"
, true);
int
num = 2;
foreach (string text
in
registryKey.GetValueNames())
{
if
(text.Contains(
"0804:"
) && text !=
"0804:00000409"
)
{
registryKey.SetValue(text, num);
num++;
}
}
registryKey.SetValue(
"0804:00000409"
, 1);
registryKey.Close();
currentUser.Close();
this
.buttonAddInPut.Enabled = false;
MessageBox.Show(
"简体中文美式键盘已添加完成,重新启动电脑后生效!"
);
Application
.Exit
();
}
// Token: 0x06000003 RID: 3 RVA: 0x0000215A File
Offset
: 0x0000035A
protected override void Dispose(bool disposing)
{
if
(disposing &&
this
.components != null)
{
this
.components.Dispose();
}
base.Dispose(disposing);
}
// Token: 0x06000004 RID: 4 RVA: 0x0000217C File
Offset
: 0x0000037C
private
void InitializeComponent()
{
this
.buttonAddInPut = new Button();
base.SuspendLayout();
this
.buttonAddInPut.Location = new Point(183, 125);
this
.buttonAddInPut.
Name
=
"buttonAddInPut"
;
this
.buttonAddInPut.
Size
= new
Size
(185, 36);
this
.buttonAddInPut.TabIndex = 0;
this
.buttonAddInPut
.Text
=
"添加简体中文美式键盘"
;
this
.buttonAddInPut.UseVisualStyleBackColor = true;
this
.buttonAddInPut.Click +=
this
.ButtonAddInPut_Click;
base.AutoScaleDimensions = new SizeF(8f, 20f);
base.AutoScaleMode = AutoScaleMode.Font;
base.ClientSize = new
Size
(550, 287);
base.Controls.
Add
(
this
.buttonAddInPut);
this
.Font = new Font(
"微软雅黑"
, 10.5f, FontStyle.Regular, GraphicsUnit.Point, 134);
base.Margin = new Padding(3, 5, 3, 5);
base.MaximizeBox = false;
base.
Name
=
"Form1"
;
base.StartPosition = FormStartPosition.CenterScreen;
base.ResumeLayout(false);
}
// Token: 0x04000001 RID: 1
private
IContainer components;
// Token: 0x04000002 RID: 2
private
Button buttonAddInPut;
}
}