diff --git a/Vichingo455 Settings/Form1.Designer.cs b/Vichingo455 Settings/Form1.Designer.cs index d7405fe..b045fc3 100644 --- a/Vichingo455 Settings/Form1.Designer.cs +++ b/Vichingo455 Settings/Form1.Designer.cs @@ -41,6 +41,9 @@ this.registryEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.commandPromptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.commandPromptToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.checkBox3 = new System.Windows.Forms.CheckBox(); + this.checkBox4 = new System.Windows.Forms.CheckBox(); this.menuStrip1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); @@ -67,6 +70,9 @@ // // groupBox1 // + this.groupBox1.Controls.Add(this.checkBox4); + this.groupBox1.Controls.Add(this.checkBox3); + this.groupBox1.Controls.Add(this.checkBox2); this.groupBox1.Controls.Add(this.checkBox1); this.groupBox1.Controls.Add(this.registry); this.groupBox1.Location = new System.Drawing.Point(12, 27); @@ -85,6 +91,7 @@ this.registry.TabIndex = 0; this.registry.Text = "Enable Registry Editor"; this.registry.UseVisualStyleBackColor = true; + this.registry.CheckedChanged += new System.EventHandler(this.registry_CheckedChanged); // // checkBox1 // @@ -149,6 +156,7 @@ this.commandPromptToolStripMenuItem.Name = "commandPromptToolStripMenuItem"; this.commandPromptToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.commandPromptToolStripMenuItem.Text = "Command Prompt"; + this.commandPromptToolStripMenuItem.Click += new System.EventHandler(this.commandPromptToolStripMenuItem_Click); // // commandPromptToolStripMenuItem1 // @@ -156,6 +164,36 @@ this.commandPromptToolStripMenuItem1.Size = new System.Drawing.Size(180, 22); this.commandPromptToolStripMenuItem1.Text = "Command Prompt"; // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Location = new System.Drawing.Point(6, 65); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(82, 17); + this.checkBox2.TabIndex = 2; + this.checkBox2.Text = "Enable Run"; + this.checkBox2.UseVisualStyleBackColor = true; + // + // checkBox3 + // + this.checkBox3.AutoSize = true; + this.checkBox3.Location = new System.Drawing.Point(6, 88); + this.checkBox3.Name = "checkBox3"; + this.checkBox3.Size = new System.Drawing.Size(125, 17); + this.checkBox3.TabIndex = 2; + this.checkBox3.Text = "Enable Control Panel"; + this.checkBox3.UseVisualStyleBackColor = true; + // + // checkBox4 + // + this.checkBox4.AutoSize = true; + this.checkBox4.Location = new System.Drawing.Point(6, 111); + this.checkBox4.Name = "checkBox4"; + this.checkBox4.Size = new System.Drawing.Size(131, 17); + this.checkBox4.TabIndex = 2; + this.checkBox4.Text = "Enable Task Manager"; + this.checkBox4.UseVisualStyleBackColor = true; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -192,6 +230,9 @@ private System.Windows.Forms.ToolStripMenuItem registryEditorToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem commandPromptToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem commandPromptToolStripMenuItem1; + private System.Windows.Forms.CheckBox checkBox4; + private System.Windows.Forms.CheckBox checkBox3; + private System.Windows.Forms.CheckBox checkBox2; } } diff --git a/Vichingo455 Settings/Form1.cs b/Vichingo455 Settings/Form1.cs index 13cdbd8..086d379 100644 --- a/Vichingo455 Settings/Form1.cs +++ b/Vichingo455 Settings/Form1.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using static Vichingo455_Settings.Utilities.RegistryWorker; namespace Vichingo455_Settings { @@ -38,5 +39,28 @@ namespace Vichingo455_Settings { Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.Windows) + @"\regedit.exe"); } + + private void commandPromptToolStripMenuItem_Click(object sender, EventArgs e) + { + Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.Windows) + @"\System32\cmd.exe"); + } + + private void registry_CheckedChanged(object sender, EventArgs e) + { + if (registry.Checked) + { + if (SetRegistryValueCurrentUserA(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System","DisableRegistryTools","0",Microsoft.Win32.RegistryValueKind.DWord) != 0) + { + MessageBox.Show("Error occured while applying Registry Editor changes. SetRegistryValueCurrentUserA returned non-zero value.","Vichingo455 Settings",MessageBoxButtons.OK,MessageBoxIcon.Error); + } + } + else + { + if (SetRegistryValueCurrentUserA(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "DisableRegistryTools", "1", Microsoft.Win32.RegistryValueKind.DWord) != 0) + { + MessageBox.Show("Error occured while applying Registry Editor changes. SetRegistryValueCurrentUserA returned non-zero value.", "Vichingo455 Settings", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } } } diff --git a/Vichingo455 Settings/Utilities/PsExec.exe b/Vichingo455 Settings/Utilities/PsExec.exe new file mode 100644 index 0000000..c7b348b Binary files /dev/null and b/Vichingo455 Settings/Utilities/PsExec.exe differ diff --git a/Vichingo455 Settings/Utilities/PsExec64.exe b/Vichingo455 Settings/Utilities/PsExec64.exe new file mode 100644 index 0000000..db94608 Binary files /dev/null and b/Vichingo455 Settings/Utilities/PsExec64.exe differ diff --git a/Vichingo455 Settings/Utilities/RegistryWorker.cs b/Vichingo455 Settings/Utilities/RegistryWorker.cs new file mode 100644 index 0000000..59cbc18 --- /dev/null +++ b/Vichingo455 Settings/Utilities/RegistryWorker.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Win32; + +namespace Vichingo455_Settings.Utilities +{ + internal class RegistryWorker + { + /// + /// Sets a registry value on the local machine + /// + /// Registry Key + /// Registry Value Name + /// Registry Value Data + /// Registry Value Type + /// + public static int SetRegistryValueLocalMachineA(string RegistryKey,string RegistryValueName, string RegistryValueData, RegistryValueKind RegistryValueType) + { + try + { + RegistryKey rk = Registry.LocalMachine.CreateSubKey(RegistryKey); + rk.SetValue(RegistryValueName,RegistryValueData,RegistryValueType); + return 0; + } + catch + { + return -1; + } + } + public static int SetRegistryValueCurrentUserA(string RegistryKey, string RegistryValueName, string RegistryValueData, RegistryValueKind RegistryValueType) + { + try + { + RegistryKey rk = Registry.CurrentUser.CreateSubKey(RegistryKey); + rk.SetValue(RegistryValueName, RegistryValueData, RegistryValueType); + return 0; + } + catch + { + return -1; + } + } + } +} diff --git a/Vichingo455 Settings/Vichingo455 Settings.csproj b/Vichingo455 Settings/Vichingo455 Settings.csproj index b3efd3f..6325bbe 100644 --- a/Vichingo455 Settings/Vichingo455 Settings.csproj +++ b/Vichingo455 Settings/Vichingo455 Settings.csproj @@ -27,7 +27,7 @@ bin\x64\Release\ TRACE true - x64 + AnyCPU 7.3 prompt @@ -95,6 +95,7 @@ + About.cs @@ -123,5 +124,14 @@ + + + + Always + + + Always + + \ No newline at end of file