mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Kill app on Eco switch
This commit is contained in:
10
ASUSWmi.cs
10
ASUSWmi.cs
@@ -1,6 +1,4 @@
|
|||||||
using GHelper;
|
using System.Management;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Management;
|
|
||||||
using System.Runtime.InteropServices;
|
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_CPUB0 = 0x001200B0; // CPU PPT on 2022
|
||||||
public const int PPT_CPUB1 = 0x001200B1; // APU PPT on 2022
|
public const int PPT_CPUB1 = 0x001200B1; // APU PPT on 2022
|
||||||
|
|
||||||
public const int PPT_APUC1 = 0x001200C1;
|
public const int PPT_APUC1 = 0x001200C1;
|
||||||
public const int PPT_APUC2 = 0x001200C2;
|
public const int PPT_APUC2 = 0x001200C2;
|
||||||
|
|
||||||
public const int PerformanceBalanced = 0;
|
public const int PerformanceBalanced = 0;
|
||||||
public const int PerformanceTurbo = 1;
|
public const int PerformanceTurbo = 1;
|
||||||
@@ -187,7 +185,7 @@ public class ASUSWmi
|
|||||||
if (curve.Length != 16) return;
|
if (curve.Length != 16) return;
|
||||||
if (curve.All(singleByte => singleByte == 0)) 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)
|
if (device == 1)
|
||||||
DeviceSet(DevsGPUFanCurve, curve);
|
DeviceSet(DevsGPUFanCurve, curve);
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
using System.Collections;
|
using System.ComponentModel;
|
||||||
using System;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using static Tools.ScreenInterrogatory;
|
using static Tools.ScreenInterrogatory;
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace Tools
|
namespace Tools
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -940,6 +940,12 @@ namespace GHelper
|
|||||||
new Thread(() =>
|
new Thread(() =>
|
||||||
{
|
{
|
||||||
Thread.CurrentThread.IsBackground = true;
|
Thread.CurrentThread.IsBackground = true;
|
||||||
|
|
||||||
|
if (eco == 1)
|
||||||
|
{
|
||||||
|
foreach (var process in Process.GetProcessesByName("EADesktop")) process.Kill();
|
||||||
|
}
|
||||||
|
|
||||||
Program.wmi.DeviceSet(ASUSWmi.GPUEco, eco);
|
Program.wmi.DeviceSet(ASUSWmi.GPUEco, eco);
|
||||||
Program.settingsForm.BeginInvoke(delegate
|
Program.settingsForm.BeginInvoke(delegate
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user