Compare commits

...

16 Commits

Author SHA1 Message Date
seerge
bc1f3ab530 Merge pull request #14 from Albert24GG/notification-feature
Send notification on performance mode cycling
2023-02-21 23:13:49 +01:00
seerge
3cd62bc9e1 Merge branch 'main' into notification-feature 2023-02-21 23:12:55 +01:00
seerge
16f6f3f934 Merge branch 'main' of https://github.com/seerge/g14-helper 2023-02-21 21:54:16 +01:00
seerge
1f4afedc1d Sensor refresh timers 2023-02-21 21:54:13 +01:00
Albert24GG
c705ce2b5b Send notification on performance mode cycling 2023-02-21 22:51:52 +02:00
seerge
75942ebdb2 Update README.md 2023-02-21 20:07:49 +01:00
seerge
6d142213c8 Minor fix 2023-02-21 19:40:16 +01:00
seerge
bfcb97b158 Update README.md 2023-02-21 19:35:18 +01:00
seerge
f97765c5c2 Performance fix 2023-02-21 19:24:43 +01:00
seerge
19a8b0dc22 Update README.md 2023-02-21 19:15:43 +01:00
seerge
f209f211b5 Added CPU / GPU temps monitoring and Charge/discharge rates in Watts 2023-02-21 19:11:50 +01:00
seerge
81a0019b42 Assure gpu mode and refresh rate are set at startup 2023-02-20 17:24:24 +01:00
seerge
3778c255bc Merge branch 'main' of https://github.com/seerge/g14-helper 2023-02-20 16:51:51 +01:00
seerge
a6b597affe Text adjustments 2023-02-20 16:51:49 +01:00
seerge
4aaba5cee7 Update README.md 2023-02-19 22:40:27 +01:00
seerge
cbbe944c2b New screenshot 2023-02-19 22:21:16 +01:00
15 changed files with 563 additions and 109 deletions

View File

@@ -2,14 +2,16 @@
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework> <TargetFramework>net7.0-windows10.0.17763.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWindowsForms>True</UseWindowsForms> <UseWindowsForms>True</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<IsPublishable>True</IsPublishable> <IsPublishable>True</IsPublishable>
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>
<StartupObject>GHelper.Program</StartupObject> <StartupObject>GHelper.Program</StartupObject>
<ApplicationIcon>Resources\standard.ico</ApplicationIcon> <ApplicationIcon>favicon.ico</ApplicationIcon>
<Platforms>AnyCPU;x64</Platforms>
<SupportedOSPlatformVersion>8.0</SupportedOSPlatformVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@@ -24,13 +26,15 @@
<ItemGroup> <ItemGroup>
<Content Include="Resources\standard.ico"> <Content Include="favicon.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="hidlibrary" Version="3.3.40" /> <PackageReference Include="hidlibrary" Version="3.3.40" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" />
<PackageReference Include="LibreHardwareMonitorLib" Version="0.9.1" />
<PackageReference Include="System.Management" Version="7.0.0" /> <PackageReference Include="System.Management" Version="7.0.0" />
<PackageReference Include="TaskScheduler" Version="2.10.1" /> <PackageReference Include="TaskScheduler" Version="2.10.1" />
</ItemGroup> </ItemGroup>

View File

@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.4.33403.182 VisualStudioVersion = 17.4.33403.182
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GHelper", "GHelper.csproj", "{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GHelper", "GHelper.csproj", "{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B6E44CC6-5D28-4CB9-8EE2-BE9D6238E2D6}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B6E44CC6-5D28-4CB9-8EE2-BE9D6238E2D6}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
@@ -13,13 +13,19 @@ EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Debug|Any CPU.Build.0 = Debug|Any CPU {D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Debug|x64.ActiveCfg = Release|x64
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Debug|x64.Build.0 = Release|x64
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Release|Any CPU.ActiveCfg = Release|Any CPU {D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Release|Any CPU.Build.0 = Release|Any CPU {D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Release|Any CPU.Build.0 = Release|Any CPU
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Release|x64.ActiveCfg = Release|x64
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Release|x64.Build.0 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@@ -1,8 +1,9 @@
using HidLibrary;
using LibreHardwareMonitor.Hardware;
using Microsoft.Win32.TaskScheduler; using Microsoft.Win32.TaskScheduler;
using System.Diagnostics; using System.Diagnostics;
using System.Management; using System.Management;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using HidLibrary;
using System.Text.Json; using System.Text.Json;
public class ASUSWmi public class ASUSWmi
@@ -224,6 +225,13 @@ public class NativeMethods
[MarshalAs(UnmanagedType.LPStruct)] Guid PowerSettingGuid, [MarshalAs(UnmanagedType.LPStruct)] Guid PowerSettingGuid,
int AcValueIndex); int AcValueIndex);
[DllImport("PowrProf.dll", CharSet = CharSet.Unicode)]
static extern UInt32 PowerWriteACValueIndex(IntPtr RootPowerKey,
[MarshalAs(UnmanagedType.LPStruct)] Guid SchemeGuid,
[MarshalAs(UnmanagedType.LPStruct)] Guid SubGroupOfPowerSettingsGuid,
[MarshalAs(UnmanagedType.LPStruct)] Guid PowerSettingGuid,
int AcValueIndex);
[DllImport("PowrProf.dll", CharSet = CharSet.Unicode)] [DllImport("PowrProf.dll", CharSet = CharSet.Unicode)]
static extern UInt32 PowerReadACValueIndex(IntPtr RootPowerKey, static extern UInt32 PowerReadACValueIndex(IntPtr RootPowerKey,
[MarshalAs(UnmanagedType.LPStruct)] Guid SchemeGuid, [MarshalAs(UnmanagedType.LPStruct)] Guid SchemeGuid,
@@ -232,14 +240,15 @@ public class NativeMethods
out IntPtr AcValueIndex out IntPtr AcValueIndex
); );
[DllImport("PowrProf.dll", CharSet = CharSet.Unicode)] [DllImport("PowrProf.dll", CharSet = CharSet.Unicode)]
static extern UInt32 PowerWriteACValueIndex(IntPtr RootPowerKey, static extern UInt32 PowerReadDCValueIndex(IntPtr RootPowerKey,
[MarshalAs(UnmanagedType.LPStruct)] Guid SchemeGuid, [MarshalAs(UnmanagedType.LPStruct)] Guid SchemeGuid,
[MarshalAs(UnmanagedType.LPStruct)] Guid SubGroupOfPowerSettingsGuid, [MarshalAs(UnmanagedType.LPStruct)] Guid SubGroupOfPowerSettingsGuid,
[MarshalAs(UnmanagedType.LPStruct)] Guid PowerSettingGuid, [MarshalAs(UnmanagedType.LPStruct)] Guid PowerSettingGuid,
int AcValueIndex); out IntPtr AcValueIndex
);
[DllImport("PowrProf.dll", CharSet = CharSet.Unicode)] [DllImport("PowrProf.dll", CharSet = CharSet.Unicode)]
static extern UInt32 PowerSetActiveScheme(IntPtr RootPowerKey, static extern UInt32 PowerSetActiveScheme(IntPtr RootPowerKey,
@@ -410,7 +419,7 @@ public class NativeMethods
{ {
Guid activeSchemeGuid = GetActiveScheme(); Guid activeSchemeGuid = GetActiveScheme();
var hr = PowerWriteACValueIndex( var hrAC = PowerWriteACValueIndex(
IntPtr.Zero, IntPtr.Zero,
activeSchemeGuid, activeSchemeGuid,
GUID_CPU, GUID_CPU,
@@ -418,6 +427,17 @@ public class NativeMethods
boost); boost);
PowerSetActiveScheme(IntPtr.Zero, activeSchemeGuid); PowerSetActiveScheme(IntPtr.Zero, activeSchemeGuid);
var hrDC = PowerWriteDCValueIndex(
IntPtr.Zero,
activeSchemeGuid,
GUID_CPU,
GUID_BOOST,
boost);
PowerSetActiveScheme(IntPtr.Zero, activeSchemeGuid);
} }
} }
@@ -432,6 +452,7 @@ public class Aura
public const int Breathe = 1; public const int Breathe = 1;
public const int Strobe = 2; public const int Strobe = 2;
public const int Rainbow = 3; public const int Rainbow = 3;
public const int Dingding = 10;
public const int SpeedSlow = 0; public const int SpeedSlow = 0;
public const int SpeedMedium = 1; public const int SpeedMedium = 1;
@@ -489,6 +510,106 @@ public class Aura
} }
public class UpdateVisitor : IVisitor
{
public void VisitComputer(IComputer computer)
{
computer.Traverse(this);
}
public void VisitHardware(IHardware hardware)
{
hardware.Update();
foreach (IHardware subHardware in hardware.SubHardware) subHardware.Accept(this);
}
public void VisitSensor(ISensor sensor) { }
public void VisitParameter(IParameter parameter) { }
}
public class HardwareMonitor
{
Computer computer;
public float? cpuTemp = -1;
public float? gpuTemp = -1;
public float? batteryDischarge = -1;
public float? batteryCharge = -1;
public HardwareMonitor()
{
computer = new Computer
{
IsCpuEnabled = true,
IsGpuEnabled = true,
IsBatteryEnabled = true,
};
}
public void ReadSensors()
{
computer.Open();
computer.Accept(new UpdateVisitor());
cpuTemp = -1;
gpuTemp = -1;
batteryDischarge = -1;
batteryCharge = -1;
foreach (IHardware hardware in computer.Hardware)
{
//Debug.WriteLine("Hardware: {0}", hardware.Name);
//Debug.WriteLine("Hardware: {0}", hardware.HardwareType);
foreach (ISensor sensor in hardware.Sensors)
{
if (sensor.SensorType == SensorType.Temperature)
{
if (hardware.HardwareType.ToString().Contains("Cpu") && sensor.Name.Contains("Core"))
{
cpuTemp = sensor.Value;
//Debug.WriteLine("\tSensor: {0}, value: {1}", sensor.Name, sensor.Value);
}
if (hardware.HardwareType.ToString().Contains("Gpu") && sensor.Name.Contains("Core"))
{
gpuTemp = sensor.Value;
}
//Debug.WriteLine("\tSensor: {0}, value: {1}", sensor.Name, sensor.Value);
}
else if (sensor.SensorType == SensorType.Power)
{
if (sensor.Name.Contains("Discharge"))
{
batteryDischarge = sensor.Value;
}
if (sensor.Name.Contains("Charge"))
{
batteryCharge = sensor.Value;
}
}
}
}
}
public void StopReading()
{
computer.Close();
}
}
namespace GHelper namespace GHelper
{ {
static class Program static class Program
@@ -499,14 +620,17 @@ namespace GHelper
public static AppConfig config; public static AppConfig config;
public static SettingsForm settingsForm; public static SettingsForm settingsForm;
public static ToastForm toastForm;
public static Startup scheduler; public static Startup scheduler;
public static HardwareMonitor hwmonitor;
// The main entry point for the application // The main entry point for the application
public static void Main() public static void Main()
{ {
trayIcon = new NotifyIcon trayIcon = new NotifyIcon
{ {
Text = "G14 Helper", Text = "G-Helper",
Icon = GHelper.Properties.Resources.standard, Icon = GHelper.Properties.Resources.standard,
Visible = true Visible = true
}; };
@@ -534,6 +658,13 @@ namespace GHelper
settingsForm.SetStartupCheck(scheduler.IsScheduled()); settingsForm.SetStartupCheck(scheduler.IsScheduled());
bool isPlugged = (System.Windows.Forms.SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online);
settingsForm.AutoGPUMode(isPlugged ? 1 : 0);
settingsForm.AutoScreen(isPlugged ? 1 : 0);
hwmonitor = new HardwareMonitor();
IntPtr dummy = settingsForm.Handle;
Application.Run(); Application.Run();
} }
@@ -553,10 +684,12 @@ namespace GHelper
{ {
case 56: // Rog button case 56: // Rog button
case 174: // FN+F5 case 174: // FN+F5
settingsForm.BeginInvoke(delegate settingsForm.BeginInvoke(delegate
{ {
settingsForm.CyclePerformanceMode(); settingsForm.CyclePerformanceMode();
}); });
return; return;
case 179: // FN+F4 case 179: // FN+F4
settingsForm.BeginInvoke(delegate settingsForm.BeginInvoke(delegate

View File

@@ -110,6 +110,16 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icons8_speed_96 {
get {
object obj = ResourceManager.GetObject("icons8-speed-96", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>

View File

@@ -142,4 +142,7 @@
<data name="icons8-laptop-48" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="icons8-laptop-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-laptop-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\icons8-laptop-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="icons8-speed-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-speed-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

View File

@@ -1,4 +1,4 @@
# G14-Helper # G-Helper (For G14, G15, ROG FLOW, and others)
A tiny system tray utility that allows you set performance and GPU profiles for your laptop. Same as ASUS Armory Crate does but without it completely!. A tiny system tray utility that allows you set performance and GPU profiles for your laptop. Same as ASUS Armory Crate does but without it completely!.
@@ -10,8 +10,8 @@ Designed for Asus Zephyrus G14 2022 (with AMD Radeon iGPU and dGPU). But could a
Profiles are **same** as in Armory Crate, including default fan curves Profiles are **same** as in Armory Crate, including default fan curves
1. Silent (minimal or no fans, 45W PPT to CPU) 1. Silent (minimal or no fans, 70W PPT total, up to 45W PPT to CPU)
2. Balanced (balanced fans, up to 45W PPT to CPU) 2. Balanced (balanced fans, 100W PPT total, up to 45W PPT to CPU)
3. Turbo (intense fans, 125W PPT total, up to 80W PPT to CPU) 3. Turbo (intense fans, 125W PPT total, up to 80W PPT to CPU)
## GPU Mode switching ## GPU Mode switching
@@ -28,7 +28,8 @@ Profiles are **same** as in Armory Crate, including default fan curves
4. Automatic switching of Standard/Eco GPU modes when laptop is plugged / unplugged! 4. Automatic switching of Standard/Eco GPU modes when laptop is plugged / unplugged!
5. FN+F5 an M4 (Rog) keys cycle through Performance modes 5. FN+F5 an M4 (Rog) keys cycle through Performance modes
6. Screen resolution and display overdrive switching 6. Screen resolution and display overdrive switching
7. Run on startup (optional) 7. CPU turbo boost switching
8. CPU & dGPU temperature monitoring in Celsius, battery charge / discharge rates in Watts
## Things still missing ## Things still missing

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

120
Settings.Designer.cs generated
View File

@@ -31,8 +31,7 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsForm));
this.checkStartup = new System.Windows.Forms.CheckBox(); this.checkStartup = new System.Windows.Forms.CheckBox();
this.trackBattery = new System.Windows.Forms.TrackBar(); this.trackBattery = new System.Windows.Forms.TrackBar();
this.labelBattery = new System.Windows.Forms.Label(); this.labelBatteryTitle = new System.Windows.Forms.Label();
this.labelBatteryLimit = new System.Windows.Forms.Label();
this.pictureBattery = new System.Windows.Forms.PictureBox(); this.pictureBattery = new System.Windows.Forms.PictureBox();
this.labelGPUFan = new System.Windows.Forms.Label(); this.labelGPUFan = new System.Windows.Forms.Label();
this.tableGPU = new System.Windows.Forms.TableLayoutPanel(); this.tableGPU = new System.Windows.Forms.TableLayoutPanel();
@@ -62,6 +61,7 @@
this.comboKeyboard = new System.Windows.Forms.ComboBox(); this.comboKeyboard = new System.Windows.Forms.ComboBox();
this.buttonKeyboardColor = new System.Windows.Forms.Button(); this.buttonKeyboardColor = new System.Windows.Forms.Button();
this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.labelBattery = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.trackBattery)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBattery)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBattery)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBattery)).BeginInit();
this.tableGPU.SuspendLayout(); this.tableGPU.SuspendLayout();
@@ -76,9 +76,8 @@
// //
// checkStartup // checkStartup
// //
this.checkStartup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.checkStartup.AutoSize = true; this.checkStartup.AutoSize = true;
this.checkStartup.Location = new System.Drawing.Point(31, 1022); this.checkStartup.Location = new System.Drawing.Point(40, 1007);
this.checkStartup.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.checkStartup.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
this.checkStartup.Name = "checkStartup"; this.checkStartup.Name = "checkStartup";
this.checkStartup.Size = new System.Drawing.Size(206, 36); this.checkStartup.Size = new System.Drawing.Size(206, 36);
@@ -92,7 +91,7 @@
this.trackBattery.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.trackBattery.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.trackBattery.LargeChange = 20; this.trackBattery.LargeChange = 20;
this.trackBattery.Location = new System.Drawing.Point(20, 919); this.trackBattery.Location = new System.Drawing.Point(20, 908);
this.trackBattery.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.trackBattery.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
this.trackBattery.Maximum = 100; this.trackBattery.Maximum = 100;
this.trackBattery.Minimum = 50; this.trackBattery.Minimum = 50;
@@ -104,49 +103,38 @@
this.trackBattery.TickStyle = System.Windows.Forms.TickStyle.TopLeft; this.trackBattery.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.trackBattery.Value = 100; this.trackBattery.Value = 100;
// //
// labelBattery // labelBatteryTitle
// //
this.labelBattery.AutoSize = true; this.labelBatteryTitle.AutoSize = true;
this.labelBattery.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); this.labelBatteryTitle.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.labelBattery.Location = new System.Drawing.Point(82, 876); this.labelBatteryTitle.Location = new System.Drawing.Point(77, 871);
this.labelBattery.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.labelBatteryTitle.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.labelBattery.Name = "labelBattery"; this.labelBatteryTitle.Name = "labelBatteryTitle";
this.labelBattery.Size = new System.Drawing.Size(248, 32); this.labelBatteryTitle.Size = new System.Drawing.Size(248, 32);
this.labelBattery.TabIndex = 4; this.labelBatteryTitle.TabIndex = 4;
this.labelBattery.Text = "Battery Charge Limit"; this.labelBatteryTitle.Text = "Battery Charge Limit";
//
// labelBatteryLimit
//
this.labelBatteryLimit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.labelBatteryLimit.AutoSize = true;
this.labelBatteryLimit.Location = new System.Drawing.Point(633, 874);
this.labelBatteryLimit.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.labelBatteryLimit.Name = "labelBatteryLimit";
this.labelBatteryLimit.Size = new System.Drawing.Size(73, 32);
this.labelBatteryLimit.TabIndex = 5;
this.labelBatteryLimit.Text = "100%";
// //
// pictureBattery // pictureBattery
// //
this.pictureBattery.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBattery.BackgroundImage"))); this.pictureBattery.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBattery.BackgroundImage")));
this.pictureBattery.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.pictureBattery.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pictureBattery.Location = new System.Drawing.Point(30, 868); this.pictureBattery.Location = new System.Drawing.Point(33, 868);
this.pictureBattery.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.pictureBattery.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
this.pictureBattery.Name = "pictureBattery"; this.pictureBattery.Name = "pictureBattery";
this.pictureBattery.Size = new System.Drawing.Size(48, 47); this.pictureBattery.Size = new System.Drawing.Size(38, 38);
this.pictureBattery.TabIndex = 6; this.pictureBattery.TabIndex = 6;
this.pictureBattery.TabStop = false; this.pictureBattery.TabStop = false;
// //
// labelGPUFan // labelGPUFan
// //
this.labelGPUFan.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.labelGPUFan.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.labelGPUFan.AutoSize = true; this.labelGPUFan.Location = new System.Drawing.Point(425, 262);
this.labelGPUFan.Location = new System.Drawing.Point(546, 262);
this.labelGPUFan.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.labelGPUFan.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.labelGPUFan.Name = "labelGPUFan"; this.labelGPUFan.Name = "labelGPUFan";
this.labelGPUFan.Size = new System.Drawing.Size(155, 32); this.labelGPUFan.Size = new System.Drawing.Size(277, 32);
this.labelGPUFan.TabIndex = 8; this.labelGPUFan.TabIndex = 8;
this.labelGPUFan.Text = "GPU Fan : 0%"; this.labelGPUFan.Text = "GPU Fan : 0%";
this.labelGPUFan.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// tableGPU // tableGPU
// //
@@ -214,7 +202,7 @@
// //
this.labelGPU.AutoSize = true; this.labelGPU.AutoSize = true;
this.labelGPU.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); this.labelGPU.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.labelGPU.Location = new System.Drawing.Point(84, 265); this.labelGPU.Location = new System.Drawing.Point(77, 265);
this.labelGPU.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.labelGPU.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.labelGPU.Name = "labelGPU"; this.labelGPU.Name = "labelGPU";
this.labelGPU.Size = new System.Drawing.Size(136, 32); this.labelGPU.Size = new System.Drawing.Size(136, 32);
@@ -225,23 +213,23 @@
// //
this.pictureGPU.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureGPU.BackgroundImage"))); this.pictureGPU.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureGPU.BackgroundImage")));
this.pictureGPU.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.pictureGPU.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pictureGPU.Location = new System.Drawing.Point(32, 256); this.pictureGPU.Location = new System.Drawing.Point(33, 263);
this.pictureGPU.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.pictureGPU.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
this.pictureGPU.Name = "pictureGPU"; this.pictureGPU.Name = "pictureGPU";
this.pictureGPU.Size = new System.Drawing.Size(48, 47); this.pictureGPU.Size = new System.Drawing.Size(38, 38);
this.pictureGPU.TabIndex = 10; this.pictureGPU.TabIndex = 10;
this.pictureGPU.TabStop = false; this.pictureGPU.TabStop = false;
// //
// labelCPUFan // labelCPUFan
// //
this.labelCPUFan.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.labelCPUFan.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.labelCPUFan.AutoSize = true; this.labelCPUFan.Location = new System.Drawing.Point(425, 38);
this.labelCPUFan.Location = new System.Drawing.Point(546, 38);
this.labelCPUFan.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.labelCPUFan.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.labelCPUFan.Name = "labelCPUFan"; this.labelCPUFan.Name = "labelCPUFan";
this.labelCPUFan.Size = new System.Drawing.Size(154, 32); this.labelCPUFan.Size = new System.Drawing.Size(277, 32);
this.labelCPUFan.TabIndex = 12; this.labelCPUFan.TabIndex = 12;
this.labelCPUFan.Text = "CPU Fan : 0%"; this.labelCPUFan.Text = "CPU Fan : 0%";
this.labelCPUFan.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// tablePerf // tablePerf
// //
@@ -254,7 +242,7 @@
this.tablePerf.Controls.Add(this.buttonTurbo, 2, 0); this.tablePerf.Controls.Add(this.buttonTurbo, 2, 0);
this.tablePerf.Controls.Add(this.buttonBalanced, 1, 0); this.tablePerf.Controls.Add(this.buttonBalanced, 1, 0);
this.tablePerf.Controls.Add(this.buttonSilent, 0, 0); this.tablePerf.Controls.Add(this.buttonSilent, 0, 0);
this.tablePerf.Location = new System.Drawing.Point(22, 79); this.tablePerf.Location = new System.Drawing.Point(22, 76);
this.tablePerf.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.tablePerf.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
this.tablePerf.Name = "tablePerf"; this.tablePerf.Name = "tablePerf";
this.tablePerf.RowCount = 1; this.tablePerf.RowCount = 1;
@@ -313,10 +301,10 @@
this.picturePerf.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("picturePerf.BackgroundImage"))); this.picturePerf.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("picturePerf.BackgroundImage")));
this.picturePerf.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.picturePerf.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.picturePerf.InitialImage = null; this.picturePerf.InitialImage = null;
this.picturePerf.Location = new System.Drawing.Point(32, 32); this.picturePerf.Location = new System.Drawing.Point(33, 36);
this.picturePerf.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.picturePerf.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
this.picturePerf.Name = "picturePerf"; this.picturePerf.Name = "picturePerf";
this.picturePerf.Size = new System.Drawing.Size(48, 47); this.picturePerf.Size = new System.Drawing.Size(38, 38);
this.picturePerf.TabIndex = 14; this.picturePerf.TabIndex = 14;
this.picturePerf.TabStop = false; this.picturePerf.TabStop = false;
// //
@@ -324,7 +312,7 @@
// //
this.labelPerf.AutoSize = true; this.labelPerf.AutoSize = true;
this.labelPerf.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); this.labelPerf.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.labelPerf.Location = new System.Drawing.Point(84, 41); this.labelPerf.Location = new System.Drawing.Point(77, 38);
this.labelPerf.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.labelPerf.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.labelPerf.Name = "labelPerf"; this.labelPerf.Name = "labelPerf";
this.labelPerf.Size = new System.Drawing.Size(234, 32); this.labelPerf.Size = new System.Drawing.Size(234, 32);
@@ -335,7 +323,7 @@
// //
this.checkGPU.AutoSize = true; this.checkGPU.AutoSize = true;
this.checkGPU.ForeColor = System.Drawing.SystemColors.GrayText; this.checkGPU.ForeColor = System.Drawing.SystemColors.GrayText;
this.checkGPU.Location = new System.Drawing.Point(33, 410); this.checkGPU.Location = new System.Drawing.Point(33, 411);
this.checkGPU.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.checkGPU.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
this.checkGPU.Name = "checkGPU"; this.checkGPU.Name = "checkGPU";
this.checkGPU.Size = new System.Drawing.Size(550, 36); this.checkGPU.Size = new System.Drawing.Size(550, 36);
@@ -346,7 +334,7 @@
// //
// buttonQuit // buttonQuit
// //
this.buttonQuit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonQuit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonQuit.BackColor = System.Drawing.SystemColors.ButtonFace; this.buttonQuit.BackColor = System.Drawing.SystemColors.ButtonFace;
this.buttonQuit.Location = new System.Drawing.Point(591, 1011); this.buttonQuit.Location = new System.Drawing.Point(591, 1011);
this.buttonQuit.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.buttonQuit.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
@@ -360,10 +348,10 @@
// //
this.pictureScreen.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureScreen.BackgroundImage"))); this.pictureScreen.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureScreen.BackgroundImage")));
this.pictureScreen.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.pictureScreen.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pictureScreen.Location = new System.Drawing.Point(32, 489); this.pictureScreen.Location = new System.Drawing.Point(33, 496);
this.pictureScreen.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.pictureScreen.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
this.pictureScreen.Name = "pictureScreen"; this.pictureScreen.Name = "pictureScreen";
this.pictureScreen.Size = new System.Drawing.Size(48, 47); this.pictureScreen.Size = new System.Drawing.Size(38, 38);
this.pictureScreen.TabIndex = 18; this.pictureScreen.TabIndex = 18;
this.pictureScreen.TabStop = false; this.pictureScreen.TabStop = false;
// //
@@ -371,7 +359,7 @@
// //
this.labelSreen.AutoSize = true; this.labelSreen.AutoSize = true;
this.labelSreen.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); this.labelSreen.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.labelSreen.Location = new System.Drawing.Point(84, 497); this.labelSreen.Location = new System.Drawing.Point(77, 496);
this.labelSreen.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.labelSreen.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.labelSreen.Name = "labelSreen"; this.labelSreen.Name = "labelSreen";
this.labelSreen.Size = new System.Drawing.Size(176, 32); this.labelSreen.Size = new System.Drawing.Size(176, 32);
@@ -388,7 +376,7 @@
this.tableScreen.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); this.tableScreen.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableScreen.Controls.Add(this.button120Hz, 1, 0); this.tableScreen.Controls.Add(this.button120Hz, 1, 0);
this.tableScreen.Controls.Add(this.button60Hz, 0, 0); this.tableScreen.Controls.Add(this.button60Hz, 0, 0);
this.tableScreen.Location = new System.Drawing.Point(22, 535); this.tableScreen.Location = new System.Drawing.Point(22, 536);
this.tableScreen.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.tableScreen.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
this.tableScreen.Name = "tableScreen"; this.tableScreen.Name = "tableScreen";
this.tableScreen.RowCount = 1; this.tableScreen.RowCount = 1;
@@ -432,7 +420,7 @@
// //
this.checkScreen.AutoSize = true; this.checkScreen.AutoSize = true;
this.checkScreen.ForeColor = System.Drawing.SystemColors.GrayText; this.checkScreen.ForeColor = System.Drawing.SystemColors.GrayText;
this.checkScreen.Location = new System.Drawing.Point(33, 638); this.checkScreen.Location = new System.Drawing.Point(33, 639);
this.checkScreen.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.checkScreen.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
this.checkScreen.Name = "checkScreen"; this.checkScreen.Name = "checkScreen";
this.checkScreen.Size = new System.Drawing.Size(527, 36); this.checkScreen.Size = new System.Drawing.Size(527, 36);
@@ -444,7 +432,7 @@
// //
this.checkBoost.AutoSize = true; this.checkBoost.AutoSize = true;
this.checkBoost.ForeColor = System.Drawing.SystemColors.GrayText; this.checkBoost.ForeColor = System.Drawing.SystemColors.GrayText;
this.checkBoost.Location = new System.Drawing.Point(33, 186); this.checkBoost.Location = new System.Drawing.Point(33, 184);
this.checkBoost.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.checkBoost.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
this.checkBoost.Name = "checkBoost"; this.checkBoost.Name = "checkBoost";
this.checkBoost.Size = new System.Drawing.Size(250, 36); this.checkBoost.Size = new System.Drawing.Size(250, 36);
@@ -456,10 +444,10 @@
// //
this.pictureBox1.BackgroundImage = global::GHelper.Properties.Resources.icons8_keyboard_48; this.pictureBox1.BackgroundImage = global::GHelper.Properties.Resources.icons8_keyboard_48;
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pictureBox1.Location = new System.Drawing.Point(33, 720); this.pictureBox1.Location = new System.Drawing.Point(33, 725);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.pictureBox1.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(42, 42); this.pictureBox1.Size = new System.Drawing.Size(36, 36);
this.pictureBox1.TabIndex = 23; this.pictureBox1.TabIndex = 23;
this.pictureBox1.TabStop = false; this.pictureBox1.TabStop = false;
// //
@@ -467,7 +455,7 @@
// //
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); this.label1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.label1.Location = new System.Drawing.Point(84, 723); this.label1.Location = new System.Drawing.Point(77, 726);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(210, 32); this.label1.Size = new System.Drawing.Size(210, 32);
@@ -484,9 +472,10 @@
"Breathe", "Breathe",
"Strobe", "Strobe",
"Rainbow"}); "Rainbow"});
this.comboKeyboard.Location = new System.Drawing.Point(40, 778); this.comboKeyboard.Location = new System.Drawing.Point(38, 778);
this.comboKeyboard.Margin = new System.Windows.Forms.Padding(0);
this.comboKeyboard.Name = "comboKeyboard"; this.comboKeyboard.Name = "comboKeyboard";
this.comboKeyboard.Size = new System.Drawing.Size(198, 40); this.comboKeyboard.Size = new System.Drawing.Size(200, 40);
this.comboKeyboard.TabIndex = 24; this.comboKeyboard.TabIndex = 24;
this.comboKeyboard.TabStop = false; this.comboKeyboard.TabStop = false;
// //
@@ -494,7 +483,7 @@
// //
this.buttonKeyboardColor.BackColor = System.Drawing.SystemColors.ButtonHighlight; this.buttonKeyboardColor.BackColor = System.Drawing.SystemColors.ButtonHighlight;
this.buttonKeyboardColor.FlatAppearance.BorderColor = System.Drawing.Color.Red; 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.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonKeyboardColor.ForeColor = System.Drawing.SystemColors.ControlText; this.buttonKeyboardColor.ForeColor = System.Drawing.SystemColors.ControlText;
this.buttonKeyboardColor.Location = new System.Drawing.Point(261, 773); this.buttonKeyboardColor.Location = new System.Drawing.Point(261, 773);
@@ -514,11 +503,23 @@
this.pictureBox2.TabIndex = 26; this.pictureBox2.TabIndex = 26;
this.pictureBox2.TabStop = false; this.pictureBox2.TabStop = false;
// //
// labelBattery
//
this.labelBattery.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.labelBattery.Location = new System.Drawing.Point(491, 869);
this.labelBattery.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.labelBattery.Name = "labelBattery";
this.labelBattery.Size = new System.Drawing.Size(211, 32);
this.labelBattery.TabIndex = 27;
this.labelBattery.Text = " ";
this.labelBattery.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// SettingsForm // SettingsForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(13F, 32F); this.AutoScaleDimensions = new System.Drawing.SizeF(13F, 32F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 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.buttonKeyboardColor);
this.Controls.Add(this.comboKeyboard); this.Controls.Add(this.comboKeyboard);
this.Controls.Add(this.pictureBox1); this.Controls.Add(this.pictureBox1);
@@ -539,8 +540,7 @@
this.Controls.Add(this.labelGPUFan); this.Controls.Add(this.labelGPUFan);
this.Controls.Add(this.tableGPU); this.Controls.Add(this.tableGPU);
this.Controls.Add(this.pictureBattery); this.Controls.Add(this.pictureBattery);
this.Controls.Add(this.labelBatteryLimit); this.Controls.Add(this.labelBatteryTitle);
this.Controls.Add(this.labelBattery);
this.Controls.Add(this.trackBattery); this.Controls.Add(this.trackBattery);
this.Controls.Add(this.checkStartup); this.Controls.Add(this.checkStartup);
this.Controls.Add(this.pictureBox2); this.Controls.Add(this.pictureBox2);
@@ -554,7 +554,7 @@
this.ShowIcon = false; this.ShowIcon = false;
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "G14 Helper"; this.Text = "G-Helper";
this.Load += new System.EventHandler(this.Settings_Load); this.Load += new System.EventHandler(this.Settings_Load);
((System.ComponentModel.ISupportInitialize)(this.trackBattery)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBattery)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBattery)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBattery)).EndInit();
@@ -574,8 +574,7 @@
#endregion #endregion
private CheckBox checkStartup; private CheckBox checkStartup;
private TrackBar trackBattery; private TrackBar trackBattery;
private Label labelBattery; private Label labelBatteryTitle;
private Label labelBatteryLimit;
private PictureBox pictureBattery; private PictureBox pictureBattery;
private Label labelGPUFan; private Label labelGPUFan;
private TableLayoutPanel tableGPU; private TableLayoutPanel tableGPU;
@@ -605,5 +604,6 @@
private ComboBox comboKeyboard; private ComboBox comboKeyboard;
private Button buttonKeyboardColor; private Button buttonKeyboardColor;
private PictureBox pictureBox2; private PictureBox pictureBox2;
private Label labelBattery;
} }
} }

View File

@@ -1,11 +1,12 @@
using Microsoft.VisualBasic.ApplicationServices; using System.Diagnostics;
using System.Diagnostics;
using System.Management;
using System.Timers; using System.Timers;
using System.Windows.Forms; using System.Windows.Forms;
using Windows.UI.Notifications;
using Microsoft.Toolkit.Uwp.Notifications;
namespace GHelper namespace GHelper
{ {
public partial class SettingsForm : Form public partial class SettingsForm : Form
{ {
@@ -88,7 +89,7 @@ namespace GHelper
Color color = Color.FromArgb(255, 255, 255); Color color = Color.FromArgb(255, 255, 255);
if (mode == -1) if (mode == -1)
mode = 0; mode = 0;
if (colorCode != -1) if (colorCode != -1)
@@ -99,7 +100,7 @@ namespace GHelper
SetAuraMode(mode, false); SetAuraMode(mode, false);
Aura.Mode = mode; Aura.Mode = mode;
} }
@@ -114,9 +115,11 @@ namespace GHelper
buttonKeyboardColor.FlatAppearance.BorderColor = color; buttonKeyboardColor.FlatAppearance.BorderColor = color;
} }
public void SetAuraMode (int mode = 0, bool apply = true) public void SetAuraMode(int mode = 0, bool apply = true)
{ {
//Debug.WriteLine(mode);
if (mode > 3) mode = 0; if (mode > 3) mode = 0;
if (Aura.Mode == mode) return; // same mode if (Aura.Mode == mode) return; // same mode
@@ -124,13 +127,16 @@ namespace GHelper
Aura.Mode = mode; Aura.Mode = mode;
Program.config.setConfig("aura_mode", mode); Program.config.setConfig("aura_mode", mode);
comboKeyboard.SelectedValueChanged -= ComboKeyboard_SelectedValueChanged;
comboKeyboard.SelectedIndex = mode;
comboKeyboard.SelectedValueChanged += ComboKeyboard_SelectedValueChanged;
if (apply) if (apply)
Aura.ApplyAura(); Aura.ApplyAura();
else
comboKeyboard.SelectedIndex = mode;
} }
public void CycleAuraMode () public void CycleAuraMode()
{ {
SetAuraMode(Program.config.getConfig("aura_mode") + 1); SetAuraMode(Program.config.getConfig("aura_mode") + 1);
} }
@@ -179,8 +185,16 @@ namespace GHelper
if (frequency > 0) if (frequency > 0)
NativeMethods.SetRefreshRate(frequency); NativeMethods.SetRefreshRate(frequency);
if (overdrive > 0) try
Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive); {
if (overdrive > 0)
Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive);
}
catch
{
Debug.WriteLine("Screen Overdrive not supported");
}
InitScreen(); InitScreen();
} }
@@ -215,7 +229,15 @@ namespace GHelper
labelSreen.Text = "Laptop Screen"; labelSreen.Text = "Laptop Screen";
} }
int overdrive = Program.wmi.DeviceGet(ASUSWmi.ScreenOverdrive); int overdrive = 0;
try
{
overdrive = Program.wmi.DeviceGet(ASUSWmi.ScreenOverdrive);
}
catch
{
Debug.WriteLine("Screen Overdrive not supported");
}
button60Hz.FlatAppearance.BorderSize = buttonInactive; button60Hz.FlatAppearance.BorderSize = buttonInactive;
button120Hz.FlatAppearance.BorderSize = buttonInactive; button120Hz.FlatAppearance.BorderSize = buttonInactive;
@@ -275,22 +297,54 @@ namespace GHelper
private static void SetTimer() private static void SetTimer()
{ {
aTimer = new System.Timers.Timer(1000); aTimer = new System.Timers.Timer(500);
aTimer.Elapsed += OnTimedEvent; aTimer.Elapsed += OnTimedEvent;
aTimer.AutoReset = true; aTimer.AutoReset = true;
aTimer.Enabled = false;
} }
private static void OnTimedEvent(Object source, ElapsedEventArgs e) private static void RefreshSensors()
{ {
var cpuFan = Math.Round(Program.wmi.DeviceGet(ASUSWmi.CPU_Fan) / 0.6); string cpuFan = " Fan: " + Math.Round(Program.wmi.DeviceGet(ASUSWmi.CPU_Fan) / 0.6).ToString() + "%";
var gpuFan = Math.Round(Program.wmi.DeviceGet(ASUSWmi.GPU_Fan) / 0.6); string gpuFan = " Fan: " + Math.Round(Program.wmi.DeviceGet(ASUSWmi.GPU_Fan) / 0.6) + "%";
string cpuTemp = "";
string gpuTemp = "";
string battery = "";
try
{
Program.hwmonitor.ReadSensors();
}
catch
{
Debug.WriteLine("Failed reading sensors");
}
if (Program.hwmonitor.cpuTemp > 0)
cpuTemp = ": " + Math.Round((decimal)Program.hwmonitor.cpuTemp).ToString() + "°C - ";
if (Program.hwmonitor.gpuTemp > 0)
gpuTemp = ": " + Math.Round((decimal)Program.hwmonitor.gpuTemp).ToString() + "°C - ";
if (Program.hwmonitor.batteryDischarge > 0)
battery = "Discharging: " + Math.Round((decimal)Program.hwmonitor.batteryDischarge, 1).ToString() + "W";
if (Program.hwmonitor.batteryCharge > 0)
battery = "Charging: " + Math.Round((decimal)Program.hwmonitor.batteryCharge, 1).ToString() + "W";
Program.settingsForm.BeginInvoke(delegate Program.settingsForm.BeginInvoke(delegate
{ {
Program.settingsForm.labelCPUFan.Text = "CPU Fan: " + cpuFan.ToString() + "%"; Program.settingsForm.labelCPUFan.Text = "CPU" + cpuTemp + cpuFan;
Program.settingsForm.labelGPUFan.Text = "GPU Fan: " + gpuFan.ToString() + "%"; Program.settingsForm.labelGPUFan.Text = "GPU" + gpuTemp + gpuFan;
Program.settingsForm.labelBattery.Text = battery;
}); });
}
private static void OnTimedEvent(Object? source, ElapsedEventArgs? e)
{
RefreshSensors();
aTimer.Interval = 2000;
} }
private void SettingsForm_VisibleChanged(object? sender, EventArgs e) private void SettingsForm_VisibleChanged(object? sender, EventArgs e)
@@ -302,39 +356,52 @@ namespace GHelper
this.Left = Screen.FromControl(this).Bounds.Width - 10 - this.Width; this.Left = Screen.FromControl(this).Bounds.Width - 10 - this.Width;
this.Top = Screen.FromControl(this).WorkingArea.Height - 10 - this.Height; this.Top = Screen.FromControl(this).WorkingArea.Height - 10 - this.Height;
this.Activate(); this.Activate();
aTimer.Interval = 500;
aTimer.Enabled = true; aTimer.Enabled = true;
} }
else else
{ {
aTimer.Enabled = false; aTimer.Enabled = false;
Program.hwmonitor.StopReading();
} }
} }
public void SetPerformanceMode(int PerformanceMode = ASUSWmi.PerformanceBalanced) public void SetPerformanceMode(int PerformanceMode = ASUSWmi.PerformanceBalanced, bool notify = false)
{ {
string perfName;
buttonSilent.FlatAppearance.BorderSize = buttonInactive; buttonSilent.FlatAppearance.BorderSize = buttonInactive;
buttonBalanced.FlatAppearance.BorderSize = buttonInactive; buttonBalanced.FlatAppearance.BorderSize = buttonInactive;
buttonTurbo.FlatAppearance.BorderSize = buttonInactive; buttonTurbo.FlatAppearance.BorderSize = buttonInactive;
string[] mode = new string[]{
"Balanced",
"Turbo",
"Silent"
};
switch (PerformanceMode) switch (PerformanceMode)
{ {
case ASUSWmi.PerformanceSilent: case ASUSWmi.PerformanceSilent:
buttonSilent.FlatAppearance.BorderSize = buttonActive; buttonSilent.FlatAppearance.BorderSize = buttonActive;
labelPerf.Text = "Performance Mode: Silent"; perfName = "Silent";
break; break;
case ASUSWmi.PerformanceTurbo: case ASUSWmi.PerformanceTurbo:
buttonTurbo.FlatAppearance.BorderSize = buttonActive; buttonTurbo.FlatAppearance.BorderSize = buttonActive;
labelPerf.Text = "Performance Mode: Turbo"; perfName = "Turbo";
break; break;
default: default:
buttonBalanced.FlatAppearance.BorderSize = buttonActive; buttonBalanced.FlatAppearance.BorderSize = buttonActive;
labelPerf.Text = "Performance Mode: Balanced";
PerformanceMode = ASUSWmi.PerformanceBalanced; PerformanceMode = ASUSWmi.PerformanceBalanced;
perfName = "Balanced";
break; break;
} }
string notifTitle = "Performance Mode Changed";
string notifBody = "Switched to: " + mode[PerformanceMode];
Program.config.setConfig("performance_mode", PerformanceMode); Program.config.setConfig("performance_mode", PerformanceMode);
try try
{ {
@@ -344,14 +411,34 @@ namespace GHelper
labelPerf.Text = "Performance Mode: not supported"; labelPerf.Text = "Performance Mode: not supported";
} }
if(notify)
sendNotification(notifTitle, notifBody);
} }
public void CyclePerformanceMode() public void CyclePerformanceMode()
{ {
SetPerformanceMode(Program.config.getConfig("performance_mode") + 1); SetPerformanceMode(Program.config.getConfig("performance_mode") + 1, true);
} }
public void sendNotification(string title, string message)
{
var content = new ToastContentBuilder()
.AddText(title)
.AddText(message)
.SetToastDuration(ToastDuration.Short)
.GetToastContent();
var notification = new ToastNotification(content.GetXml())
{
Priority = ToastNotificationPriority.High
};
ToastNotificationManagerCompat.CreateToastNotifier().Show(notification);
}
public void AutoScreen(int Plugged = 1) public void AutoScreen(int Plugged = 1)
{ {
int ScreenAuto = Program.config.getConfig("screen_auto"); int ScreenAuto = Program.config.getConfig("screen_auto");
@@ -362,6 +449,8 @@ namespace GHelper
else else
SetScreen(60, 0); SetScreen(60, 0);
InitScreen();
} }
public void AutoGPUMode(int Plugged = 1) public void AutoGPUMode(int Plugged = 1)
@@ -382,18 +471,12 @@ namespace GHelper
if (eco == 1 && Plugged == 1) // Eco going Standard on plugged if (eco == 1 && Plugged == 1) // Eco going Standard on plugged
{ {
Program.wmi.DeviceSet(ASUSWmi.GPUEco, 0); Program.wmi.DeviceSet(ASUSWmi.GPUEco, 0);
InitGPUMode();
GPUMode = ASUSWmi.GPUModeStandard;
VisualiseGPUMode(GPUMode);
Program.config.setConfig("gpu_mode", GPUMode);
} }
else if (eco == 0 && Plugged == 0) // Standard going Eco on plugged else if (eco == 0 && Plugged == 0) // Standard going Eco on plugged
{ {
Program.wmi.DeviceSet(ASUSWmi.GPUEco, 1); Program.wmi.DeviceSet(ASUSWmi.GPUEco, 1);
InitGPUMode();
GPUMode = ASUSWmi.GPUModeEco;
VisualiseGPUMode(GPUMode);
Program.config.setConfig("gpu_mode", GPUMode);
} }
} }
@@ -570,12 +653,13 @@ namespace GHelper
if (limit < 50 || limit > 100) limit = 100; if (limit < 50 || limit > 100) limit = 100;
labelBatteryLimit.Text = limit.ToString() + "%"; labelBatteryTitle.Text = "Battery Charge Limit: " + limit.ToString() + "%";
trackBattery.Value = limit; trackBattery.Value = limit;
try try
{ {
Program.wmi.DeviceSet(ASUSWmi.BatteryLimit, limit); Program.wmi.DeviceSet(ASUSWmi.BatteryLimit, limit);
} catch }
catch
{ {
Debug.WriteLine("Can't set battery charge limit"); Debug.WriteLine("Can't set battery charge limit");
} }

85
ToastForm.Designer.cs generated Normal file
View File

@@ -0,0 +1,85 @@
namespace GHelper
{
partial class ToastForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.pictureIcon = new System.Windows.Forms.PictureBox();
this.labelMode = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureIcon)).BeginInit();
this.SuspendLayout();
//
// pictureIcon
//
this.pictureIcon.BackgroundImage = global::GHelper.Properties.Resources.icons8_speed_96;
this.pictureIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pictureIcon.Location = new System.Drawing.Point(21, 21);
this.pictureIcon.Name = "pictureIcon";
this.pictureIcon.Size = new System.Drawing.Size(82, 80);
this.pictureIcon.TabIndex = 0;
this.pictureIcon.TabStop = false;
//
// labelMode
//
this.labelMode.AutoSize = true;
this.labelMode.Font = new System.Drawing.Font("Segoe UI", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.labelMode.Location = new System.Drawing.Point(127, 32);
this.labelMode.Name = "labelMode";
this.labelMode.Size = new System.Drawing.Size(195, 59);
this.labelMode.TabIndex = 1;
this.labelMode.Text = "Balanced";
this.labelMode.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// ToastForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(13F, 32F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.ClientSize = new System.Drawing.Size(356, 122);
this.Controls.Add(this.labelMode);
this.Controls.Add(this.pictureIcon);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.MdiChildrenMinimizedAnchorBottom = false;
this.MinimizeBox = false;
this.Name = "ToastForm";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.Text = "ToastForm";
this.TopMost = true;
((System.ComponentModel.ISupportInitialize)(this.pictureIcon)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private PictureBox pictureIcon;
private Label labelMode;
}
}

68
ToastForm.cs Normal file
View File

@@ -0,0 +1,68 @@
using System.Runtime.InteropServices;
namespace GHelper
{
public partial class ToastForm : Form
{
private System.Windows.Forms.Timer timer = default!;
private const int SW_SHOWNOACTIVATE = 4;
private const int HWND_TOPMOST = -1;
private const uint SWP_NOACTIVATE = 0x0010;
[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
static extern bool SetWindowPos(
int hWnd, // Window handle
int hWndInsertAfter, // Placement-order handle
int X, // Horizontal position
int Y, // Vertical position
int cx, // Width
int cy, // Height
uint uFlags); // Window positioning flags
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
static void ShowInactiveTopmost(Form frm)
{
ShowWindow(frm.Handle, SW_SHOWNOACTIVATE);
SetWindowPos(frm.Handle.ToInt32(), HWND_TOPMOST,
frm.Left, frm.Top, frm.Width, frm.Height,
SWP_NOACTIVATE);
}
public ToastForm()
{
InitializeComponent();
}
public void RunToast(string text)
{
Top = Screen.FromControl(this).WorkingArea.Height - this.Height - 100;
Left = (Screen.FromControl(this).Bounds.Width - this.Width) / 2;
ShowInactiveTopmost(this);
labelMode.Text = text;
timer = new System.Windows.Forms.Timer();
timer.Tick += new EventHandler(timer_Tick);
timer.Enabled = true;
timer.Interval = 1000;
timer.Start();
}
private void ToastForm_Show(object? sender, EventArgs e)
{
}
private void timer_Tick(object sender, EventArgs e)
{
timer.Stop();
Close();
}
}
}

60
ToastForm.resx Normal file
View File

@@ -0,0 +1,60 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

BIN
favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

BIN
null

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 813 KiB

After

Width:  |  Height:  |  Size: 2.3 MiB