diff --git a/app/Fans.cs b/app/Fans.cs index e52c1354..81895ffd 100644 --- a/app/Fans.cs +++ b/app/Fans.cs @@ -207,11 +207,13 @@ namespace GHelper private void Fans_FormClosing(object? sender, FormClosingEventArgs e) { + + /* if (e.CloseReason == CloseReason.UserClosing) { e.Cancel = true; Hide(); - } + }*/ } diff --git a/app/HardwareMonitor.cs b/app/HardwareMonitor.cs index f7c77047..e213a1bc 100644 --- a/app/HardwareMonitor.cs +++ b/app/HardwareMonitor.cs @@ -15,7 +15,6 @@ public static class HardwareMonitor public static string? gpuFan; public static string? midFan; - //public static List gpuUsage = new List(); public static int? gpuUse; public static int GetFanMax() @@ -78,9 +77,10 @@ public static class HardwareMonitor if (cpuTemp < 0) try { - var ct = new PerformanceCounter("Thermal Zone Information", "Temperature", @"\_TZ.THRM", true); - cpuTemp = ct.NextValue() - 273; - ct.Dispose(); + using (var ct = new PerformanceCounter("Thermal Zone Information", "Temperature", @"\_TZ.THRM", true)) + { + cpuTemp = ct.NextValue() - 273; + } } catch { @@ -102,17 +102,12 @@ public static class HardwareMonitor if (gpuTemp is null || gpuTemp < 0) gpuTemp = Program.wmi.DeviceGet(ASUSWmi.Temp_GPU); - /* - gpuUsage.Add(GetGpuUse()); - if (gpuUsage.Count > 3) gpuUsage.RemoveAt(0); - */ - try { - var cb = new PerformanceCounter("Power Meter", "Power", "Power Meter (0)", true); - batteryDischarge = cb.NextValue() / 1000; - cb.Dispose(); - + using (var cb = new PerformanceCounter("Power Meter", "Power", "Power Meter (0)", true)) + { + batteryDischarge = cb.NextValue() / 1000; + } } catch { diff --git a/app/Properties/Resources.resx b/app/Properties/Resources.resx index 7f7ef70e..9dbe76e7 100644 --- a/app/Properties/Resources.resx +++ b/app/Properties/Resources.resx @@ -206,7 +206,7 @@ ..\Resources\icons8-speed-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\everything-is-fine-itsfine.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\itsfine.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\icons8-help-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/app/Resources/everything-is-fine-itsfine.gif b/app/Resources/everything-is-fine-itsfine.gif deleted file mode 100644 index 6f73fb4b..00000000 Binary files a/app/Resources/everything-is-fine-itsfine.gif and /dev/null differ diff --git a/app/Resources/itsfine.jpg b/app/Resources/itsfine.jpg new file mode 100644 index 00000000..44b594f2 Binary files /dev/null and b/app/Resources/itsfine.jpg differ diff --git a/app/Settings.cs b/app/Settings.cs index fc7109df..9a8f2804 100644 --- a/app/Settings.cs +++ b/app/Settings.cs @@ -560,7 +560,7 @@ namespace GHelper if (fans.Visible) { - fans.Hide(); + fans.Close(); } else { @@ -917,7 +917,7 @@ namespace GHelper if (cpuResult != 1 || gpuResult != 1) { int mode = Program.config.getConfig("performance_mode"); - Logger.WriteLine("Driver rejected fan curve, resetting mode to " + mode); + Logger.WriteLine("ASUS BIOS rejected fan curve, resetting mode to " + mode); Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, mode, "PerformanceMode"); } else customFans = true;