diff --git a/Program.cs b/Program.cs index 825e7718..2166f56b 100644 --- a/Program.cs +++ b/Program.cs @@ -1,11 +1,10 @@ +using HidLibrary; +using LibreHardwareMonitor.Hardware; using Microsoft.Win32.TaskScheduler; using System.Diagnostics; using System.Management; using System.Runtime.InteropServices; -using HidLibrary; using System.Text.Json; -using LibreHardwareMonitor.Hardware; -using System.Threading; public class ASUSWmi { @@ -232,7 +231,7 @@ public class NativeMethods [MarshalAs(UnmanagedType.LPStruct)] Guid SubGroupOfPowerSettingsGuid, [MarshalAs(UnmanagedType.LPStruct)] Guid PowerSettingGuid, int AcValueIndex); - + [DllImport("PowrProf.dll", CharSet = CharSet.Unicode)] static extern UInt32 PowerReadACValueIndex(IntPtr RootPowerKey, [MarshalAs(UnmanagedType.LPStruct)] Guid SchemeGuid, @@ -550,7 +549,7 @@ public class HardwareMonitor public void ReadSensors() { - + computer.Open(); computer.Accept(new UpdateVisitor()); diff --git a/Settings.Designer.cs b/Settings.Designer.cs index 860a8049..7372ec57 100644 --- a/Settings.Designer.cs +++ b/Settings.Designer.cs @@ -473,6 +473,7 @@ "Strobe", "Rainbow"}); this.comboKeyboard.Location = new System.Drawing.Point(38, 778); + this.comboKeyboard.Margin = new System.Windows.Forms.Padding(0); this.comboKeyboard.Name = "comboKeyboard"; this.comboKeyboard.Size = new System.Drawing.Size(200, 40); this.comboKeyboard.TabIndex = 24; @@ -482,7 +483,7 @@ // this.buttonKeyboardColor.BackColor = System.Drawing.SystemColors.ButtonHighlight; this.buttonKeyboardColor.FlatAppearance.BorderColor = System.Drawing.Color.Red; - this.buttonKeyboardColor.FlatAppearance.BorderSize = 4; + this.buttonKeyboardColor.FlatAppearance.BorderSize = 3; this.buttonKeyboardColor.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.buttonKeyboardColor.ForeColor = System.Drawing.SystemColors.ControlText; this.buttonKeyboardColor.Location = new System.Drawing.Point(261, 773); @@ -517,7 +518,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(13F, 32F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(744, 1085); + this.ClientSize = new System.Drawing.Size(744, 1093); this.Controls.Add(this.labelBattery); this.Controls.Add(this.buttonKeyboardColor); this.Controls.Add(this.comboKeyboard); diff --git a/Settings.cs b/Settings.cs index 573aea3a..9fbeb6e0 100644 --- a/Settings.cs +++ b/Settings.cs @@ -294,9 +294,10 @@ namespace GHelper private static void SetTimer() { - aTimer = new System.Timers.Timer(2000); + aTimer = new System.Timers.Timer(500); aTimer.Elapsed += OnTimedEvent; aTimer.AutoReset = true; + aTimer.Enabled = false; } private static void RefreshSensors() @@ -340,6 +341,7 @@ namespace GHelper private static void OnTimedEvent(Object? source, ElapsedEventArgs? e) { RefreshSensors(); + aTimer.Interval = 2000; } private void SettingsForm_VisibleChanged(object? sender, EventArgs e) @@ -352,7 +354,7 @@ namespace GHelper this.Top = Screen.FromControl(this).WorkingArea.Height - 10 - this.Height; this.Activate(); - //RefreshSensors(); + aTimer.Interval = 500; aTimer.Enabled = true; }