Kill app on Eco switch

This commit is contained in:
seerge
2023-03-15 21:25:49 +01:00
parent 80b9fdb8ac
commit 99d3c61897
3 changed files with 11 additions and 10 deletions

View File

@@ -1,6 +1,4 @@
using GHelper;
using System.Diagnostics;
using System.Management;
using System.Management;
using System.Runtime.InteropServices;
@@ -35,8 +33,8 @@ public class ASUSWmi
public const int PPT_CPUB0 = 0x001200B0; // CPU PPT on 2022
public const int PPT_CPUB1 = 0x001200B1; // APU PPT on 2022
public const int PPT_APUC1 = 0x001200C1;
public const int PPT_APUC2 = 0x001200C2;
public const int PPT_APUC1 = 0x001200C1;
public const int PPT_APUC2 = 0x001200C2;
public const int PerformanceBalanced = 0;
public const int PerformanceTurbo = 1;
@@ -187,7 +185,7 @@ public class ASUSWmi
if (curve.Length != 16) return;
if (curve.All(singleByte => singleByte == 0)) return;
Logger.WriteLine("Fans" + ((device == 1)?"GPU":"CPU") + " " + BitConverter.ToString(curve));
Logger.WriteLine("Fans" + ((device == 1) ? "GPU" : "CPU") + " " + BitConverter.ToString(curve));
if (device == 1)
DeviceSet(DevsGPUFanCurve, curve);

View File

@@ -1,10 +1,7 @@
using System.Collections;
using System;
using System.ComponentModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.InteropServices;
using static Tools.ScreenInterrogatory;
using System.Windows.Forms;
namespace Tools
{

View File

@@ -940,6 +940,12 @@ namespace GHelper
new Thread(() =>
{
Thread.CurrentThread.IsBackground = true;
if (eco == 1)
{
foreach (var process in Process.GetProcessesByName("EADesktop")) process.Kill();
}
Program.wmi.DeviceSet(ASUSWmi.GPUEco, eco);
Program.settingsForm.BeginInvoke(delegate
{