Support for TUF RGB keyboards and other fixes

This commit is contained in:
seerge
2023-03-25 14:37:37 +01:00
parent 8bc9325b3f
commit 7702dc8e38
7 changed files with 373 additions and 195 deletions

View File

@@ -23,8 +23,7 @@ namespace GHelper
public static SettingsForm settingsForm = new SettingsForm();
public static ToastForm toast = new ToastForm();
private static IntPtr unRegPowerNotify;
private static IntPtr ds;
public static IntPtr unRegPowerNotify;
private static long lastAuto;
private static long lastTheme;
@@ -56,7 +55,7 @@ namespace GHelper
SystemEvents.UserPreferenceChanged += new
UserPreferenceChangedEventHandler(SystemEvents_UserPreferenceChanged);
ds = settingsForm.Handle;
var ds = settingsForm.Handle;
trayIcon.MouseClick += TrayIcon_MouseClick;
@@ -72,10 +71,6 @@ namespace GHelper
SetAutoModes();
HardwareMonitor.RecreateGpuTemperatureProvider();
// Subscribing for monitor power on events
var settingGuid = new NativeMethods.PowerSettingGuid();
unRegPowerNotify = NativeMethods.RegisterPowerSettingNotification(ds, settingGuid.ConsoleDisplayState, NativeMethods.DEVICE_NOTIFY_WINDOW_HANDLE);
// Subscribing for system power change events
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;