From a008d1a5e6b8a4dc85ac8f4745e0773c406a6e32 Mon Sep 17 00:00:00 2001 From: Troy Cook Date: Sat, 21 Nov 2020 22:09:22 -0600 Subject: [PATCH] Fixes to Yilanst #13 --- KVMControl.cs | 50 ++++++++++++++---- KVMControlHook.cs | 15 ++---- MainForm.Designer.cs | 15 +++--- MainForm.cs | 48 +++++++++-------- MainForm.resx | 22 ++++---- MeshCentralRouter.csproj | 2 + Program.cs | 2 +- Settings.cs | 27 ++++++++++ SettingsForm.Designer.cs | 27 ++++++++++ SettingsForm.cs | 31 +++++++++++ SettingsForm.resx | 109 ++++++++++++++++++++++++++++++++++++--- 11 files changed, 276 insertions(+), 72 deletions(-) create mode 100644 Settings.cs diff --git a/KVMControl.cs b/KVMControl.cs index 370cdf4..093398e 100644 --- a/KVMControl.cs +++ b/KVMControl.cs @@ -47,7 +47,10 @@ namespace MeshCentralRouter public double DpiX = 96; public double DpiY = 96; public KVMViewer parent = null; + private readonly KVMControlHook ControlHook; private readonly KVMControlHook.KVMCallback KeyboardCallback; + private bool isHookWanted; + private bool isHookPriority; private bool keyboardIsAttached; @@ -127,14 +130,32 @@ namespace MeshCentralRouter this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.MouseWheel += new System.Windows.Forms.MouseEventHandler(KVMControl_MouseWheel); - KeyboardCallback = SendKey; + if (Settings.GetRegValue("Exp_KeyboardHook", "false").ToLower() == "true") + { + ControlHook = new KVMControlHook(); + KeyboardCallback = SendKey; + isHookWanted = true; + } + else + { + isHookWanted = false; + } + if (Settings.GetRegValue("Exp_KeyboardHookPriority", "false").ToLower() == "true") + { + isHookPriority = true; + } + else + { + isHookPriority = false; + } } public void AttachKeyboard() { - if (!keyboardIsAttached) + Console.WriteLine(isHookWanted); + if (!keyboardIsAttached && isHookWanted) { - Program.controlHook.AttachCallback(KeyboardCallback); + ControlHook.AttachKeyboardHook(SendKey); keyboardIsAttached = true; } } @@ -143,7 +164,7 @@ namespace MeshCentralRouter { if (keyboardIsAttached) { - Program.controlHook.DetachCallback(); + ControlHook.DetachKeyboardHook(); keyboardIsAttached = false; } } @@ -648,20 +669,29 @@ namespace MeshCentralRouter private void KVMControl_KeyDown(object sender, KeyEventArgs e) { - if ((e.KeyCode == Keys.LWin) || (e.KeyCode == Keys.RWin)) return; // Don't process the Windows key - SendKey(e, 0); - e.Handled = true; + if (!isHookPriority) + { + if ((e.KeyCode == Keys.LWin) || (e.KeyCode == Keys.RWin)) return; // Don't process the Windows key + SendKey(e, 0); + e.Handled = true; + } } private void KVMControl_KeyPress(object sender, KeyPressEventArgs e) { - e.Handled = true; + if (!isHookPriority) + { + e.Handled = true; + } } private void KVMControl_KeyUp(object sender, KeyEventArgs e) { - SendKey(e, 1); - e.Handled = true; + if (!isHookPriority) + { + SendKey(e, 1); + e.Handled = true; + } } protected override bool ProcessCmdKey(ref Message msg, Keys keyData) diff --git a/KVMControlHook.cs b/KVMControlHook.cs index 1565239..c32346f 100644 --- a/KVMControlHook.cs +++ b/KVMControlHook.cs @@ -15,14 +15,14 @@ namespace MeshCentralRouter internal KVMControlHook() { _proc = HookCallback; - AttachKeyboardHook(); } - private void AttachKeyboardHook() + internal void AttachKeyboardHook(KVMCallback callback) { try { _hook = KVMKeyboardHook.SetHook(_proc); + _callback = callback; } catch { @@ -31,18 +31,9 @@ namespace MeshCentralRouter } } - internal void AttachCallback(KVMCallback callback) - { - _callback = callback; - } - - internal void DetachCallback() + internal void DetachKeyboardHook() { _callback = null; - } - - internal static void DetachKeyboardHook() - { if (_hook != IntPtr.Zero) KVMKeyboardHook.UnhookWindowsHookEx(_hook); } diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index c9ab01b..fe2c2ce 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -93,6 +93,7 @@ this.addRelayMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator(); this.remoteDesktopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.remoteFilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.httpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.httpsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.rdpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -126,7 +127,6 @@ this.saveMappingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openMapFileDialog = new System.Windows.Forms.OpenFileDialog(); this.saveMapFileDialog = new System.Windows.Forms.SaveFileDialog(); - this.remoteFilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.panel5.SuspendLayout(); this.mainPanel.SuspendLayout(); this.mainTabControl.SuspendLayout(); @@ -582,6 +582,7 @@ this.devicesListView.FullRowSelect = true; this.devicesListView.GridLines = true; this.devicesListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.devicesListView.HideSelection = false; this.devicesListView.LargeImageList = this.devicesImageList; resources.ApplyResources(this.devicesListView, "devicesListView"); this.devicesListView.MultiSelect = false; @@ -640,6 +641,12 @@ resources.ApplyResources(this.remoteDesktopToolStripMenuItem, "remoteDesktopToolStripMenuItem"); this.remoteDesktopToolStripMenuItem.Click += new System.EventHandler(this.remoteDesktopToolStripMenuItem_Click); // + // remoteFilesToolStripMenuItem + // + this.remoteFilesToolStripMenuItem.Name = "remoteFilesToolStripMenuItem"; + resources.ApplyResources(this.remoteFilesToolStripMenuItem, "remoteFilesToolStripMenuItem"); + this.remoteFilesToolStripMenuItem.Click += new System.EventHandler(this.remoteFilesToolStripMenuItem_Click); + // // httpToolStripMenuItem // this.httpToolStripMenuItem.Name = "httpToolStripMenuItem"; @@ -871,12 +878,6 @@ this.saveMapFileDialog.DefaultExt = "mcrouter"; resources.ApplyResources(this.saveMapFileDialog, "saveMapFileDialog"); // - // remoteFilesToolStripMenuItem - // - this.remoteFilesToolStripMenuItem.Name = "remoteFilesToolStripMenuItem"; - resources.ApplyResources(this.remoteFilesToolStripMenuItem, "remoteFilesToolStripMenuItem"); - this.remoteFilesToolStripMenuItem.Click += new System.EventHandler(this.remoteFilesToolStripMenuItem_Click); - // // MainForm // resources.ApplyResources(this, "$this"); diff --git a/MainForm.cs b/MainForm.cs index 0e5a49b..b06103a 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -84,6 +84,7 @@ namespace MeshCentralRouter { if (IsAdministrator() == false) { + // Restart program and run as admin var exeName = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; ProcessStartInfo startInfo = new ProcessStartInfo(exeName, "-install"); @@ -138,14 +139,6 @@ namespace MeshCentralRouter [DllImport("user32.dll", CharSet = CharSet.Auto)] private static extern Int32 SendMessage(IntPtr hWnd, int msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)]string lParam); - public void setRegValue(string name, string value) - { - try { Registry.SetValue(@"HKEY_CURRENT_USER\SOFTWARE\Open Source\MeshCentral Router", name, value); } catch (Exception) { } - } - public string getRegValue(string name, string value) - { - try {return Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Open Source\MeshCentral Router", name, value).ToString(); } catch (Exception) { return value; } - } public MainForm(string[] args) { @@ -159,8 +152,8 @@ namespace MeshCentralRouter Version version = Assembly.GetEntryAssembly().GetName().Version; versionLabel.Text = "v" + version.Major + "." + version.Minor + "." + version.Build; - serverNameComboBox.Text = getRegValue("ServerName", ""); - userNameTextBox.Text = getRegValue("UserName", ""); + serverNameComboBox.Text = Settings.GetRegValue("ServerName", ""); + userNameTextBox.Text = Settings.GetRegValue("UserName", ""); title = this.Text; int argflags = 0; @@ -206,9 +199,9 @@ namespace MeshCentralRouter private void MainForm_Load(object sender, EventArgs e) { // Load registry settings - showGroupNamesToolStripMenuItem.Checked = (getRegValue("Show Group Names", "1") == "1"); - showOfflineDevicesToolStripMenuItem.Checked = (getRegValue("Show Offline Devices", "1") == "1"); - if (getRegValue("Device Sort", "Name") == "Name") { + showGroupNamesToolStripMenuItem.Checked = (Settings.GetRegValue("Show Group Names", "1") == "1"); + showOfflineDevicesToolStripMenuItem.Checked = (Settings.GetRegValue("Show Offline Devices", "1") == "1"); + if (Settings.GetRegValue("Device Sort", "Name") == "Name") { sortByNameToolStripMenuItem.Checked = true; sortByGroupToolStripMenuItem.Checked = false; } else { @@ -319,12 +312,12 @@ namespace MeshCentralRouter } else { - string ignoreCert = getRegValue("IgnoreCert", null); + string ignoreCert = Settings.GetRegValue("IgnoreCert", null); if (ignoreCert != null) { meshcentral.okCertHash = ignoreCert; } } // Load two factor cookie if present - string twoFactorCookie = getRegValue("TwoFactorCookie", null); + string twoFactorCookie = Settings.GetRegValue("TwoFactorCookie", null); if ((twoFactorCookie != null) && (twoFactorCookie != "")) { twoFactorCookie = "cookie=" + twoFactorCookie; } else { twoFactorCookie = null; } Uri serverurl = null; @@ -363,13 +356,13 @@ namespace MeshCentralRouter private void Meshcentral_onTwoFactorCookie(string cookie) { if (this.InvokeRequired) { this.Invoke(new MeshCentralServer.twoFactorCookieHandler(Meshcentral_onTwoFactorCookie), cookie); return; } - setRegValue("TwoFactorCookie", cookie); + Settings.SetRegValue("TwoFactorCookie", cookie); } private void nextButton3_Click(object sender, EventArgs e) { // If we need to remember this certificate - if (rememberCertCheckBox.Checked) { setRegValue("IgnoreCert", lastBadConnectCert.GetCertHashString()); } + if (rememberCertCheckBox.Checked) { Settings.SetRegValue("IgnoreCert", lastBadConnectCert.GetCertHashString()); } // Attempt to login, ignore bad cert. addButton.Enabled = false; @@ -393,7 +386,7 @@ namespace MeshCentralRouter meshcentral.connect(serverurl, null, null, null); } else { // Load two factor cookie if present - string twoFactorCookie = getRegValue("TwoFactorCookie", null); + string twoFactorCookie = Settings.GetRegValue("TwoFactorCookie", null); if ((twoFactorCookie != null) && (twoFactorCookie != "")) { twoFactorCookie = "cookie=" + twoFactorCookie; } else { twoFactorCookie = null; } serverurl = new Uri("wss://" + serverNameComboBox.Text + "/control.ashx"); meshcentral.connect(serverurl, userNameTextBox.Text, passwordTextBox.Text, twoFactorCookie); @@ -690,8 +683,8 @@ namespace MeshCentralRouter addButton.Focus(); if (authLoginUrl == null) { - setRegValue("ServerName", serverNameComboBox.Text); - setRegValue("UserName", userNameTextBox.Text); + Settings.SetRegValue("ServerName", serverNameComboBox.Text); + Settings.SetRegValue("UserName", userNameTextBox.Text); } if (meshcentral.username != null) { this.Text = title + " - " + meshcentral.username; @@ -927,7 +920,7 @@ namespace MeshCentralRouter if (lastBadConnectCert != null) { meshcentral.okCertHash = lastBadConnectCert.GetCertHashString(); } else { - string ignoreCert = getRegValue("IgnoreCert", null); + string ignoreCert = Settings.GetRegValue("IgnoreCert", null); if (ignoreCert != null) { meshcentral.okCertHash = ignoreCert; } } meshcentral.onStateChanged += Meshcentral_onStateChanged; @@ -1076,9 +1069,14 @@ namespace MeshCentralRouter SettingsForm f = new SettingsForm(); f.BindAllInterfaces = inaddrany; f.ShowSystemTray = (notifyIcon.Visible == true); + f.Exp_KeyboardHookPriority = Settings.GetRegValue("Exp_KeyboardHookPriority", "false") == "true" ? true : false; + f.Exp_KeyboardHook = Settings.GetRegValue("Exp_KeyboardHook", "false") == "true" ? true : false; + if (f.ShowDialog(this) == DialogResult.OK) { inaddrany = f.BindAllInterfaces; + Settings.SetRegValue("Exp_KeyboardHook", f.Exp_KeyboardHook.ToString().ToLower()); + Settings.SetRegValue("Exp_KeyboardHookPriority", f.Exp_KeyboardHookPriority.ToString().ToLower()); if (f.ShowSystemTray) { notifyIcon.Visible = true; this.ShowInTaskbar = false; @@ -1223,14 +1221,14 @@ namespace MeshCentralRouter private void showGroupNamesToolStripMenuItem_Click(object sender, EventArgs e) { showGroupNamesToolStripMenuItem.Checked = !showGroupNamesToolStripMenuItem.Checked; - setRegValue("Show Group Names", showGroupNamesToolStripMenuItem.Checked ? "1" : "0"); + Settings.SetRegValue("Show Group Names", showGroupNamesToolStripMenuItem.Checked ? "1" : "0"); updateDeviceList(); } private void hideOfflineDevicesToolStripMenuItem_Click(object sender, EventArgs e) { showOfflineDevicesToolStripMenuItem.Checked = !showOfflineDevicesToolStripMenuItem.Checked; - setRegValue("Show Offline Devices", showOfflineDevicesToolStripMenuItem.Checked?"1":"0"); + Settings.SetRegValue("Show Offline Devices", showOfflineDevicesToolStripMenuItem.Checked?"1":"0"); updateDeviceList(); } @@ -1238,7 +1236,7 @@ namespace MeshCentralRouter { sortByNameToolStripMenuItem.Checked = true; sortByGroupToolStripMenuItem.Checked = false; - setRegValue("Device Sort", "Name"); + Settings.SetRegValue("Device Sort", "Name"); updateDeviceList(); } @@ -1246,7 +1244,7 @@ namespace MeshCentralRouter { sortByNameToolStripMenuItem.Checked = false; sortByGroupToolStripMenuItem.Checked = true; - setRegValue("Device Sort", "Group"); + Settings.SetRegValue("Device Sort", "Group"); updateDeviceList(); } diff --git a/MainForm.resx b/MainForm.resx index df2b22d..aab6acc 100644 --- a/MainForm.resx +++ b/MainForm.resx @@ -1462,7 +1462,7 @@ SCP - 171, 230 + 171, 208 devicesContextMenuStrip @@ -1478,7 +1478,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADg - HQAAAk1TRnQBSQFMAgEBEAEAASgBAAEoAQABEAEAARABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFA + HQAAAk1TRnQBSQFMAgEBEAEAATABAAEwAQABEAEAARABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFA AwABUAMAAQEBAAEYBgABPP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AJYAA/0D+AP3A/sD/yEAA/0D+gP5 A/wD/xgAAfoB+wH6A/4qAAP9A/8tAAP7A88D1QPbA88D1AO+A9QYAAP8A90D4APjA90D4APUA+MSAAP8 AZEBjwF9AU4BaAEhAfQB9QH0JAAD/gPRA8YD+ioAAcYCxwHPAtAB2ALZA90DywPBA68DmgP3FQAD2APd @@ -1645,7 +1645,7 @@ 2, 88 - 438, 52 + 434, 52 5 @@ -1684,7 +1684,7 @@ 2, 88 - 438, 52 + 434, 52 4 @@ -1774,7 +1774,7 @@ 2, 79 - 438, 52 + 434, 52 4 @@ -5814,6 +5814,12 @@ Click "Add" to get started. System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + remoteFilesToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + httpToolStripMenuItem @@ -5916,12 +5922,6 @@ Click "Add" to get started. System.Windows.Forms.SaveFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - remoteFilesToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - MainForm diff --git a/MeshCentralRouter.csproj b/MeshCentralRouter.csproj index 9482c68..a11419d 100644 --- a/MeshCentralRouter.csproj +++ b/MeshCentralRouter.csproj @@ -124,6 +124,7 @@ FileViewer.cs + Form @@ -221,6 +222,7 @@ ServerUserControl.cs + Form diff --git a/Program.cs b/Program.cs index 77fbb4e..b5d11f2 100644 --- a/Program.cs +++ b/Program.cs @@ -22,13 +22,13 @@ namespace MeshCentralRouter { static class Program { - public static KVMControlHook controlHook = new KVMControlHook(); /// /// The main entry point for the application. /// [STAThread] static void Main(string[] args) { + // Setup settings & visual style Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); diff --git a/Settings.cs b/Settings.cs new file mode 100644 index 0000000..34327a4 --- /dev/null +++ b/Settings.cs @@ -0,0 +1,27 @@ +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MeshCentralRouter +{ + public static class Settings + { + public static void SetRegValue(string name, string value) + { + try { Registry.SetValue(@"HKEY_CURRENT_USER\SOFTWARE\Open Source\MeshCentral Router", name, value); } catch (Exception) { } + } + /// + /// This function querys the registry. If the key is found it returns the value + /// + /// Keyname + /// Return on fail + /// + public static string GetRegValue(string name, string value) + { + try { return Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Open Source\MeshCentral Router", name, value).ToString(); } catch (Exception) { return value; } + } + } +} diff --git a/SettingsForm.Designer.cs b/SettingsForm.Designer.cs index d6e3a7a..41db19a 100644 --- a/SettingsForm.Designer.cs +++ b/SettingsForm.Designer.cs @@ -34,6 +34,9 @@ this.groupBox1 = new System.Windows.Forms.GroupBox(); this.systemTrayCheckBox = new System.Windows.Forms.CheckBox(); this.allInterfacesCheckBox = new System.Windows.Forms.CheckBox(); + this.exp_KeyboardHookCheckBox = new System.Windows.Forms.CheckBox(); + this.exp_KeyboardHookPriorityCheckBox = new System.Windows.Forms.CheckBox(); + this.label1 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // @@ -55,6 +58,9 @@ // groupBox1 // resources.ApplyResources(this.groupBox1, "groupBox1"); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.exp_KeyboardHookPriorityCheckBox); + this.groupBox1.Controls.Add(this.exp_KeyboardHookCheckBox); this.groupBox1.Controls.Add(this.systemTrayCheckBox); this.groupBox1.Controls.Add(this.allInterfacesCheckBox); this.groupBox1.Name = "groupBox1"; @@ -72,6 +78,24 @@ this.allInterfacesCheckBox.Name = "allInterfacesCheckBox"; this.allInterfacesCheckBox.UseVisualStyleBackColor = true; // + // exp_KeyboardHookCheckBox + // + resources.ApplyResources(this.exp_KeyboardHookCheckBox, "exp_KeyboardHookCheckBox"); + this.exp_KeyboardHookCheckBox.Name = "exp_KeyboardHookCheckBox"; + this.exp_KeyboardHookCheckBox.UseVisualStyleBackColor = true; + this.exp_KeyboardHookCheckBox.CheckedChanged += new System.EventHandler(this.exp_KeyboardHookCheckBox_CheckedChanged); + // + // exp_KeyboardHookPriorityCheckBox + // + resources.ApplyResources(this.exp_KeyboardHookPriorityCheckBox, "exp_KeyboardHookPriorityCheckBox"); + this.exp_KeyboardHookPriorityCheckBox.Name = "exp_KeyboardHookPriorityCheckBox"; + this.exp_KeyboardHookPriorityCheckBox.UseVisualStyleBackColor = true; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // // SettingsForm // this.AcceptButton = this.okButton; @@ -98,5 +122,8 @@ private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.CheckBox systemTrayCheckBox; private System.Windows.Forms.CheckBox allInterfacesCheckBox; + private System.Windows.Forms.CheckBox exp_KeyboardHookCheckBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.CheckBox exp_KeyboardHookPriorityCheckBox; } } \ No newline at end of file diff --git a/SettingsForm.cs b/SettingsForm.cs index 8892942..144cb51 100644 --- a/SettingsForm.cs +++ b/SettingsForm.cs @@ -28,6 +28,25 @@ namespace MeshCentralRouter set { systemTrayCheckBox.Checked = value; } } + public bool Exp_KeyboardHook + { + get { return exp_KeyboardHookCheckBox.Checked; } + set { + exp_KeyboardHookCheckBox.Checked = value; + if (!value) + { + exp_KeyboardHookPriorityCheckBox.Checked = false; + exp_KeyboardHookPriorityCheckBox.Enabled = false; + } + } + } + + public bool Exp_KeyboardHookPriority + { + get { return exp_KeyboardHookPriorityCheckBox.Checked; } + set { exp_KeyboardHookPriorityCheckBox.Checked = value; } + } + private void okButton_Click(object sender, EventArgs e) { DialogResult = DialogResult.OK; @@ -37,5 +56,17 @@ namespace MeshCentralRouter { DialogResult = DialogResult.Cancel; } + + private void exp_KeyboardHookCheckBox_CheckedChanged(object sender, EventArgs e) + { + if (exp_KeyboardHookCheckBox.Checked) + { + exp_KeyboardHookPriorityCheckBox.Enabled = true; + } else + { + exp_KeyboardHookPriorityCheckBox.Checked = false; + exp_KeyboardHookPriorityCheckBox.Enabled = false; + } + } } } diff --git a/SettingsForm.resx b/SettingsForm.resx index a73bc0c..5be7ff3 100644 --- a/SettingsForm.resx +++ b/SettingsForm.resx @@ -123,7 +123,7 @@ - 231, 94 + 231, 266 75, 23 @@ -151,7 +151,7 @@ Bottom, Right - 150, 94 + 150, 266 75, 23 @@ -177,6 +177,103 @@ Top, Bottom, Left, Right + + True + + + NoControl + + + 10, 139 + + + 196, 13 + + + 4 + + + Experimental Features (Use at own risk!) + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + True + + + NoControl + + + 13, 155 + + + 244, 69 + + + 3 + + + Override all default keyboard input with +the keyboard hook in remote desktop +(This is not considered stable use at own risk) +This will allow for all key combinations execept +CTRL + ALT + DEL + + + + exp_KeyboardHookPriorityCheckBox + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 1 + + + True + + + NoControl + + + 13, 68 + + + 210, 43 + + + 2 + + + Enable experimental keyboard hook +(This may make some antiviruses mad!) +This will allow special keys + + + exp_KeyboardHookCheckBox + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 2 + True @@ -202,7 +299,7 @@ groupBox1 - 0 + 3 True @@ -229,13 +326,13 @@ groupBox1 - 1 + 4 12, 12 - 294, 76 + 294, 248 2 @@ -262,7 +359,7 @@ 6, 13 - 318, 129 + 318, 301