Minor fixes, Factory default profiles will apply immediately on click

This commit is contained in:
seerge
2023-02-23 14:14:11 +01:00
parent 41d92d76cc
commit 02ae48092b
6 changed files with 152 additions and 123 deletions

View File

@@ -116,7 +116,7 @@ public class ASUSWmi
BitConverter.GetBytes((uint)args.Length).CopyTo(acpiBuf, 4);
Array.Copy(args, 0, acpiBuf, 8, args.Length);
//Debug.WriteLine(BitConverter.ToString(acpiBuf, 0, acpiBuf.Length));
// if (MethodID == DEVS) Debug.WriteLine(BitConverter.ToString(acpiBuf, 0, acpiBuf.Length));
Control(CONTROL_CODE, acpiBuf, outBuffer);
@@ -161,6 +161,7 @@ public class ASUSWmi
public void SetFanCurve(int device, byte[] curve)
{
if (device == 1)
DeviceSet(DevsGPUFanCurve, curve);
else

2
Fans.Designer.cs generated
View File

@@ -73,7 +73,7 @@
buttonReset.Name = "buttonReset";
buttonReset.Size = new Size(254, 46);
buttonReset.TabIndex = 2;
buttonReset.Text = "Load Default";
buttonReset.Text = "Factory Defaults";
buttonReset.UseVisualStyleBackColor = true;
//
// chartGPU

45
Fans.cs
View File

@@ -11,9 +11,24 @@ namespace GHelper
Series seriesCPU;
Series seriesGPU;
void SetChart(Chart chart, string title)
void SetChart(Chart chart, int device)
{
chart.Titles.Add(title);
string title;
if (device == 1)
title = "GPU Fan Profile";
else
title = "CPU Fan Profile";
if (Program.settingsForm.perfName.Length > 0)
title += ": " + Program.settingsForm.perfName;
if (chart.Titles.Count > 0)
chart.Titles[0].Text = title;
else
chart.Titles.Add(title);
chart.ChartAreas[0].AxisX.Minimum = 10;
chart.ChartAreas[0].AxisX.Maximum = 100;
chart.ChartAreas[0].AxisX.Interval = 10;
@@ -23,12 +38,16 @@ namespace GHelper
}
private void Fans_Shown(object? sender, EventArgs e)
{
Top = Program.settingsForm.Top;
Left = Program.settingsForm.Left - Width - 10;
}
public Fans()
{
InitializeComponent();
SetChart(chartCPU, "CPU Fan Profile");
SetChart(chartGPU, "GPU Fan Profile");
InitializeComponent();
seriesCPU = chartCPU.Series.Add("CPU");
seriesGPU = chartGPU.Series.Add("GPU");
@@ -47,12 +66,19 @@ namespace GHelper
buttonReset.Click += ButtonReset_Click;
buttonApply.Click += ButtonApply_Click;
Shown += Fans_Shown;
}
public void LoadFans()
{
SetChart(chartCPU, 0);
SetChart(chartGPU, 0);
LoadProfile(seriesCPU, 0);
LoadProfile(seriesGPU, 1);
}
byte[] StringToBytes(string str)
@@ -87,16 +113,16 @@ namespace GHelper
int mode = Program.config.getConfig("performance_mode");
string curveString = Program.config.getConfigString(GetFanName(device));
byte[] curve = {};
byte[] curve = { };
if (curveString is not null)
curve = StringToBytes(curveString);
if (def == 1 || curve.Length < 16)
if (def == 1 || curve.Length != 16)
curve = Program.wmi.GetFanCurve(device, mode);
Debug.WriteLine(BitConverter.ToString(curve));
//Debug.WriteLine(BitConverter.ToString(curve));
byte old = 0;
for (int i = 0; i < 8; i++)
@@ -138,6 +164,7 @@ namespace GHelper
{
LoadProfile(seriesCPU, 0, 1);
LoadProfile(seriesGPU, 1, 1);
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"));
}
private void ChartCPU_MouseUp(object? sender, MouseEventArgs e)

214
Settings.Designer.cs generated
View File

@@ -76,10 +76,10 @@
// checkStartup
//
checkStartup.AutoSize = true;
checkStartup.Location = new Point(41, 1007);
checkStartup.Margin = new Padding(4, 2, 4, 2);
checkStartup.Location = new Point(20, 508);
checkStartup.Margin = new Padding(2, 1, 2, 1);
checkStartup.Name = "checkStartup";
checkStartup.Size = new Size(206, 36);
checkStartup.Size = new Size(105, 19);
checkStartup.TabIndex = 2;
checkStartup.Text = "Run on Startup";
checkStartup.UseVisualStyleBackColor = true;
@@ -89,12 +89,12 @@
//
trackBattery.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
trackBattery.LargeChange = 20;
trackBattery.Location = new Point(20, 909);
trackBattery.Margin = new Padding(4, 2, 4, 2);
trackBattery.Location = new Point(10, 454);
trackBattery.Margin = new Padding(2, 1, 2, 1);
trackBattery.Maximum = 100;
trackBattery.Minimum = 50;
trackBattery.Name = "trackBattery";
trackBattery.Size = new Size(674, 90);
trackBattery.Size = new Size(338, 45);
trackBattery.SmallChange = 10;
trackBattery.TabIndex = 3;
trackBattery.TickFrequency = 10;
@@ -105,10 +105,10 @@
//
labelBatteryTitle.AutoSize = true;
labelBatteryTitle.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelBatteryTitle.Location = new Point(76, 870);
labelBatteryTitle.Margin = new Padding(4, 0, 4, 0);
labelBatteryTitle.Location = new Point(38, 435);
labelBatteryTitle.Margin = new Padding(2, 0, 2, 0);
labelBatteryTitle.Name = "labelBatteryTitle";
labelBatteryTitle.Size = new Size(248, 32);
labelBatteryTitle.Size = new Size(122, 15);
labelBatteryTitle.TabIndex = 4;
labelBatteryTitle.Text = "Battery Charge Limit";
//
@@ -116,20 +116,20 @@
//
pictureBattery.BackgroundImage = (Image)resources.GetObject("pictureBattery.BackgroundImage");
pictureBattery.BackgroundImageLayout = ImageLayout.Zoom;
pictureBattery.Location = new Point(33, 868);
pictureBattery.Margin = new Padding(4, 2, 4, 2);
pictureBattery.Location = new Point(16, 434);
pictureBattery.Margin = new Padding(2, 1, 2, 1);
pictureBattery.Name = "pictureBattery";
pictureBattery.Size = new Size(37, 38);
pictureBattery.Size = new Size(18, 19);
pictureBattery.TabIndex = 6;
pictureBattery.TabStop = false;
//
// labelGPUFan
//
labelGPUFan.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelGPUFan.Location = new Point(409, 262);
labelGPUFan.Margin = new Padding(4, 0, 4, 0);
labelGPUFan.Location = new Point(205, 131);
labelGPUFan.Margin = new Padding(2, 0, 2, 0);
labelGPUFan.Name = "labelGPUFan";
labelGPUFan.Size = new Size(277, 32);
labelGPUFan.Size = new Size(138, 16);
labelGPUFan.TabIndex = 8;
labelGPUFan.Text = "GPU Fan : 0%";
labelGPUFan.TextAlign = ContentAlignment.TopRight;
@@ -144,12 +144,12 @@
tableGPU.Controls.Add(buttonUltimate, 2, 0);
tableGPU.Controls.Add(buttonStandard, 1, 0);
tableGPU.Controls.Add(buttonEco, 0, 0);
tableGPU.Location = new Point(22, 303);
tableGPU.Margin = new Padding(4, 2, 4, 2);
tableGPU.Location = new Point(11, 152);
tableGPU.Margin = new Padding(2, 1, 2, 1);
tableGPU.Name = "tableGPU";
tableGPU.RowCount = 1;
tableGPU.RowStyles.Add(new RowStyle(SizeType.Absolute, 107F));
tableGPU.Size = new Size(674, 107);
tableGPU.RowStyles.Add(new RowStyle(SizeType.Absolute, 54F));
tableGPU.Size = new Size(338, 54);
tableGPU.TabIndex = 7;
//
// buttonUltimate
@@ -158,10 +158,10 @@
buttonUltimate.Dock = DockStyle.Fill;
buttonUltimate.FlatAppearance.BorderSize = 0;
buttonUltimate.FlatStyle = FlatStyle.Flat;
buttonUltimate.Location = new Point(457, 11);
buttonUltimate.Margin = new Padding(9, 11, 9, 11);
buttonUltimate.Location = new Point(228, 6);
buttonUltimate.Margin = new Padding(4, 6, 4, 6);
buttonUltimate.Name = "buttonUltimate";
buttonUltimate.Size = new Size(208, 85);
buttonUltimate.Size = new Size(106, 42);
buttonUltimate.TabIndex = 2;
buttonUltimate.Text = "Ultimate";
buttonUltimate.UseVisualStyleBackColor = false;
@@ -172,10 +172,10 @@
buttonStandard.Dock = DockStyle.Fill;
buttonStandard.FlatAppearance.BorderSize = 0;
buttonStandard.FlatStyle = FlatStyle.Flat;
buttonStandard.Location = new Point(233, 11);
buttonStandard.Margin = new Padding(9, 11, 9, 11);
buttonStandard.Location = new Point(116, 6);
buttonStandard.Margin = new Padding(4, 6, 4, 6);
buttonStandard.Name = "buttonStandard";
buttonStandard.Size = new Size(206, 85);
buttonStandard.Size = new Size(104, 42);
buttonStandard.TabIndex = 1;
buttonStandard.Text = "Standard";
buttonStandard.UseVisualStyleBackColor = false;
@@ -187,10 +187,10 @@
buttonEco.Dock = DockStyle.Fill;
buttonEco.FlatAppearance.BorderSize = 0;
buttonEco.FlatStyle = FlatStyle.Flat;
buttonEco.Location = new Point(9, 11);
buttonEco.Margin = new Padding(9, 11, 9, 11);
buttonEco.Location = new Point(4, 6);
buttonEco.Margin = new Padding(4, 6, 4, 6);
buttonEco.Name = "buttonEco";
buttonEco.Size = new Size(206, 85);
buttonEco.Size = new Size(104, 42);
buttonEco.TabIndex = 0;
buttonEco.Text = "Eco";
buttonEco.UseVisualStyleBackColor = false;
@@ -199,10 +199,10 @@
//
labelGPU.AutoSize = true;
labelGPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelGPU.Location = new Point(76, 265);
labelGPU.Margin = new Padding(4, 0, 4, 0);
labelGPU.Location = new Point(38, 132);
labelGPU.Margin = new Padding(2, 0, 2, 0);
labelGPU.Name = "labelGPU";
labelGPU.Size = new Size(136, 32);
labelGPU.Size = new Size(67, 15);
labelGPU.TabIndex = 9;
labelGPU.Text = "GPU Mode";
//
@@ -210,20 +210,20 @@
//
pictureGPU.BackgroundImage = (Image)resources.GetObject("pictureGPU.BackgroundImage");
pictureGPU.BackgroundImageLayout = ImageLayout.Zoom;
pictureGPU.Location = new Point(33, 262);
pictureGPU.Margin = new Padding(4, 2, 4, 2);
pictureGPU.Location = new Point(16, 131);
pictureGPU.Margin = new Padding(2, 1, 2, 1);
pictureGPU.Name = "pictureGPU";
pictureGPU.Size = new Size(37, 38);
pictureGPU.Size = new Size(18, 19);
pictureGPU.TabIndex = 10;
pictureGPU.TabStop = false;
//
// labelCPUFan
//
labelCPUFan.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelCPUFan.Location = new Point(409, 38);
labelCPUFan.Margin = new Padding(4, 0, 4, 0);
labelCPUFan.Location = new Point(205, 19);
labelCPUFan.Margin = new Padding(2, 0, 2, 0);
labelCPUFan.Name = "labelCPUFan";
labelCPUFan.Size = new Size(277, 32);
labelCPUFan.Size = new Size(138, 16);
labelCPUFan.TabIndex = 12;
labelCPUFan.Text = "CPU Fan : 0%";
labelCPUFan.TextAlign = ContentAlignment.TopRight;
@@ -238,12 +238,12 @@
tablePerf.Controls.Add(buttonTurbo, 2, 0);
tablePerf.Controls.Add(buttonBalanced, 1, 0);
tablePerf.Controls.Add(buttonSilent, 0, 0);
tablePerf.Location = new Point(22, 77);
tablePerf.Margin = new Padding(4, 2, 4, 2);
tablePerf.Location = new Point(11, 38);
tablePerf.Margin = new Padding(2, 1, 2, 1);
tablePerf.Name = "tablePerf";
tablePerf.RowCount = 1;
tablePerf.RowStyles.Add(new RowStyle(SizeType.Absolute, 107F));
tablePerf.Size = new Size(674, 107);
tablePerf.RowStyles.Add(new RowStyle(SizeType.Absolute, 54F));
tablePerf.Size = new Size(338, 54);
tablePerf.TabIndex = 11;
//
// buttonTurbo
@@ -253,10 +253,10 @@
buttonTurbo.FlatAppearance.BorderColor = Color.FromArgb(192, 0, 0);
buttonTurbo.FlatAppearance.BorderSize = 0;
buttonTurbo.FlatStyle = FlatStyle.Flat;
buttonTurbo.Location = new Point(457, 11);
buttonTurbo.Margin = new Padding(9, 11, 9, 11);
buttonTurbo.Location = new Point(228, 6);
buttonTurbo.Margin = new Padding(4, 6, 4, 6);
buttonTurbo.Name = "buttonTurbo";
buttonTurbo.Size = new Size(208, 85);
buttonTurbo.Size = new Size(106, 42);
buttonTurbo.TabIndex = 2;
buttonTurbo.Text = "Turbo";
buttonTurbo.UseVisualStyleBackColor = false;
@@ -268,10 +268,10 @@
buttonBalanced.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 192);
buttonBalanced.FlatAppearance.BorderSize = 0;
buttonBalanced.FlatStyle = FlatStyle.Flat;
buttonBalanced.Location = new Point(233, 11);
buttonBalanced.Margin = new Padding(9, 11, 9, 11);
buttonBalanced.Location = new Point(116, 6);
buttonBalanced.Margin = new Padding(4, 6, 4, 6);
buttonBalanced.Name = "buttonBalanced";
buttonBalanced.Size = new Size(206, 85);
buttonBalanced.Size = new Size(104, 42);
buttonBalanced.TabIndex = 1;
buttonBalanced.Text = "Balanced";
buttonBalanced.UseVisualStyleBackColor = false;
@@ -284,10 +284,10 @@
buttonSilent.FlatAppearance.BorderColor = Color.FromArgb(0, 192, 192);
buttonSilent.FlatAppearance.BorderSize = 0;
buttonSilent.FlatStyle = FlatStyle.Flat;
buttonSilent.Location = new Point(9, 11);
buttonSilent.Margin = new Padding(9, 11, 9, 11);
buttonSilent.Location = new Point(4, 6);
buttonSilent.Margin = new Padding(4, 6, 4, 6);
buttonSilent.Name = "buttonSilent";
buttonSilent.Size = new Size(206, 85);
buttonSilent.Size = new Size(104, 42);
buttonSilent.TabIndex = 0;
buttonSilent.Text = "Silent";
buttonSilent.UseVisualStyleBackColor = false;
@@ -297,10 +297,10 @@
picturePerf.BackgroundImage = (Image)resources.GetObject("picturePerf.BackgroundImage");
picturePerf.BackgroundImageLayout = ImageLayout.Zoom;
picturePerf.InitialImage = null;
picturePerf.Location = new Point(33, 36);
picturePerf.Margin = new Padding(4, 2, 4, 2);
picturePerf.Location = new Point(16, 18);
picturePerf.Margin = new Padding(2, 1, 2, 1);
picturePerf.Name = "picturePerf";
picturePerf.Size = new Size(37, 38);
picturePerf.Size = new Size(18, 19);
picturePerf.TabIndex = 14;
picturePerf.TabStop = false;
//
@@ -308,10 +308,10 @@
//
labelPerf.AutoSize = true;
labelPerf.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelPerf.Location = new Point(76, 38);
labelPerf.Margin = new Padding(4, 0, 4, 0);
labelPerf.Location = new Point(38, 19);
labelPerf.Margin = new Padding(2, 0, 2, 0);
labelPerf.Name = "labelPerf";
labelPerf.Size = new Size(234, 32);
labelPerf.Size = new Size(115, 15);
labelPerf.TabIndex = 13;
labelPerf.Text = "Performance Mode";
//
@@ -319,10 +319,10 @@
//
checkGPU.AutoSize = true;
checkGPU.ForeColor = SystemColors.GrayText;
checkGPU.Location = new Point(33, 412);
checkGPU.Margin = new Padding(4, 2, 4, 2);
checkGPU.Location = new Point(16, 206);
checkGPU.Margin = new Padding(2, 1, 2, 1);
checkGPU.Name = "checkGPU";
checkGPU.Size = new Size(550, 36);
checkGPU.Size = new Size(273, 19);
checkGPU.TabIndex = 15;
checkGPU.Text = "Set Eco on battery and Standard when plugged";
checkGPU.UseVisualStyleBackColor = true;
@@ -332,10 +332,10 @@
//
buttonQuit.Anchor = AnchorStyles.Top | AnchorStyles.Right;
buttonQuit.BackColor = SystemColors.ButtonFace;
buttonQuit.Location = new Point(574, 1011);
buttonQuit.Margin = new Padding(4, 2, 4, 2);
buttonQuit.Location = new Point(288, 504);
buttonQuit.Margin = new Padding(2, 1, 2, 1);
buttonQuit.Name = "buttonQuit";
buttonQuit.Size = new Size(121, 47);
buttonQuit.Size = new Size(60, 24);
buttonQuit.TabIndex = 16;
buttonQuit.Text = "Quit";
buttonQuit.UseVisualStyleBackColor = false;
@@ -344,10 +344,10 @@
//
pictureScreen.BackgroundImage = (Image)resources.GetObject("pictureScreen.BackgroundImage");
pictureScreen.BackgroundImageLayout = ImageLayout.Zoom;
pictureScreen.Location = new Point(33, 495);
pictureScreen.Margin = new Padding(4, 2, 4, 2);
pictureScreen.Location = new Point(16, 248);
pictureScreen.Margin = new Padding(2, 1, 2, 1);
pictureScreen.Name = "pictureScreen";
pictureScreen.Size = new Size(37, 38);
pictureScreen.Size = new Size(18, 19);
pictureScreen.TabIndex = 18;
pictureScreen.TabStop = false;
//
@@ -355,10 +355,10 @@
//
labelSreen.AutoSize = true;
labelSreen.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelSreen.Location = new Point(76, 495);
labelSreen.Margin = new Padding(4, 0, 4, 0);
labelSreen.Location = new Point(38, 248);
labelSreen.Margin = new Padding(2, 0, 2, 0);
labelSreen.Name = "labelSreen";
labelSreen.Size = new Size(176, 32);
labelSreen.Size = new Size(87, 15);
labelSreen.TabIndex = 17;
labelSreen.Text = "Laptop Screen";
//
@@ -371,12 +371,12 @@
tableScreen.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F));
tableScreen.Controls.Add(button120Hz, 1, 0);
tableScreen.Controls.Add(button60Hz, 0, 0);
tableScreen.Location = new Point(22, 535);
tableScreen.Margin = new Padding(4, 2, 4, 2);
tableScreen.Location = new Point(11, 268);
tableScreen.Margin = new Padding(2, 1, 2, 1);
tableScreen.Name = "tableScreen";
tableScreen.RowCount = 1;
tableScreen.RowStyles.Add(new RowStyle(SizeType.Absolute, 107F));
tableScreen.Size = new Size(674, 107);
tableScreen.RowStyles.Add(new RowStyle(SizeType.Absolute, 54F));
tableScreen.Size = new Size(338, 54);
tableScreen.TabIndex = 19;
//
// button120Hz
@@ -386,10 +386,10 @@
button120Hz.FlatAppearance.BorderColor = SystemColors.ActiveBorder;
button120Hz.FlatAppearance.BorderSize = 0;
button120Hz.FlatStyle = FlatStyle.Flat;
button120Hz.Location = new Point(233, 11);
button120Hz.Margin = new Padding(9, 11, 9, 11);
button120Hz.Location = new Point(116, 6);
button120Hz.Margin = new Padding(4, 6, 4, 6);
button120Hz.Name = "button120Hz";
button120Hz.Size = new Size(206, 85);
button120Hz.Size = new Size(104, 42);
button120Hz.TabIndex = 1;
button120Hz.Text = "120Hz + OD";
button120Hz.UseVisualStyleBackColor = false;
@@ -403,10 +403,10 @@
button60Hz.FlatAppearance.BorderSize = 0;
button60Hz.FlatStyle = FlatStyle.Flat;
button60Hz.ForeColor = SystemColors.ControlText;
button60Hz.Location = new Point(9, 11);
button60Hz.Margin = new Padding(9, 11, 9, 11);
button60Hz.Location = new Point(4, 6);
button60Hz.Margin = new Padding(4, 6, 4, 6);
button60Hz.Name = "button60Hz";
button60Hz.Size = new Size(206, 85);
button60Hz.Size = new Size(104, 42);
button60Hz.TabIndex = 0;
button60Hz.Text = "60Hz";
button60Hz.UseVisualStyleBackColor = false;
@@ -415,10 +415,10 @@
//
checkScreen.AutoSize = true;
checkScreen.ForeColor = SystemColors.GrayText;
checkScreen.Location = new Point(33, 644);
checkScreen.Margin = new Padding(4, 2, 4, 2);
checkScreen.Location = new Point(16, 322);
checkScreen.Margin = new Padding(2, 1, 2, 1);
checkScreen.Name = "checkScreen";
checkScreen.Size = new Size(527, 36);
checkScreen.Size = new Size(261, 19);
checkScreen.TabIndex = 20;
checkScreen.Text = "Set 60Hz on battery, and back when plugged";
checkScreen.UseVisualStyleBackColor = true;
@@ -427,22 +427,22 @@
//
checkBoost.AutoSize = true;
checkBoost.ForeColor = SystemColors.GrayText;
checkBoost.Location = new Point(33, 184);
checkBoost.Margin = new Padding(4, 2, 4, 2);
checkBoost.Location = new Point(16, 92);
checkBoost.Margin = new Padding(2, 1, 2, 1);
checkBoost.Name = "checkBoost";
checkBoost.Size = new Size(250, 36);
checkBoost.Size = new Size(161, 19);
checkBoost.TabIndex = 21;
checkBoost.Text = "CPU Boost enabled";
checkBoost.Text = "CPU Turbo Boost enabled";
checkBoost.UseVisualStyleBackColor = true;
//
// pictureBox1
//
pictureBox1.BackgroundImage = Properties.Resources.icons8_keyboard_48;
pictureBox1.BackgroundImageLayout = ImageLayout.Zoom;
pictureBox1.Location = new Point(33, 725);
pictureBox1.Margin = new Padding(4, 2, 4, 2);
pictureBox1.Location = new Point(16, 362);
pictureBox1.Margin = new Padding(2, 1, 2, 1);
pictureBox1.Name = "pictureBox1";
pictureBox1.Size = new Size(35, 36);
pictureBox1.Size = new Size(18, 18);
pictureBox1.TabIndex = 23;
pictureBox1.TabStop = false;
//
@@ -450,10 +450,10 @@
//
label1.AutoSize = true;
label1.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
label1.Location = new Point(76, 725);
label1.Margin = new Padding(4, 0, 4, 0);
label1.Location = new Point(38, 362);
label1.Margin = new Padding(2, 0, 2, 0);
label1.Name = "label1";
label1.Size = new Size(210, 32);
label1.Size = new Size(101, 15);
label1.TabIndex = 22;
label1.Text = "Laptop Keyboard";
//
@@ -462,12 +462,12 @@
comboKeyboard.FlatStyle = FlatStyle.Flat;
comboKeyboard.Font = new Font("Segoe UI", 10F, FontStyle.Regular, GraphicsUnit.Point);
comboKeyboard.FormattingEnabled = true;
comboKeyboard.ItemHeight = 37;
comboKeyboard.ItemHeight = 17;
comboKeyboard.Items.AddRange(new object[] { "Static", "Breathe", "Strobe", "Rainbow" });
comboKeyboard.Location = new Point(37, 777);
comboKeyboard.Location = new Point(18, 388);
comboKeyboard.Margin = new Padding(0);
comboKeyboard.Name = "comboKeyboard";
comboKeyboard.Size = new Size(201, 45);
comboKeyboard.Size = new Size(102, 25);
comboKeyboard.TabIndex = 24;
comboKeyboard.TabStop = false;
//
@@ -479,10 +479,10 @@
buttonKeyboardColor.FlatAppearance.BorderSize = 2;
buttonKeyboardColor.FlatStyle = FlatStyle.Flat;
buttonKeyboardColor.ForeColor = SystemColors.ControlText;
buttonKeyboardColor.Location = new Point(256, 775);
buttonKeyboardColor.Location = new Point(128, 388);
buttonKeyboardColor.Margin = new Padding(0);
buttonKeyboardColor.Name = "buttonKeyboardColor";
buttonKeyboardColor.Size = new Size(212, 50);
buttonKeyboardColor.Size = new Size(106, 29);
buttonKeyboardColor.TabIndex = 25;
buttonKeyboardColor.Text = "Color";
buttonKeyboardColor.UseVisualStyleBackColor = false;
@@ -490,10 +490,10 @@
// labelBattery
//
labelBattery.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelBattery.Location = new Point(409, 868);
labelBattery.Margin = new Padding(4, 0, 4, 0);
labelBattery.Location = new Point(205, 434);
labelBattery.Margin = new Padding(2, 0, 2, 0);
labelBattery.Name = "labelBattery";
labelBattery.Size = new Size(277, 32);
labelBattery.Size = new Size(138, 16);
labelBattery.TabIndex = 27;
labelBattery.Text = " ";
labelBattery.TextAlign = ContentAlignment.TopRight;
@@ -502,19 +502,19 @@
//
buttonFans.Anchor = AnchorStyles.Top | AnchorStyles.Right;
buttonFans.BackColor = SystemColors.ButtonFace;
buttonFans.Location = new Point(525, 186);
buttonFans.Margin = new Padding(4, 2, 4, 2);
buttonFans.Location = new Point(263, 93);
buttonFans.Margin = new Padding(2, 1, 2, 1);
buttonFans.Name = "buttonFans";
buttonFans.Size = new Size(165, 47);
buttonFans.Size = new Size(82, 24);
buttonFans.TabIndex = 28;
buttonFans.Text = "Fan Profile";
buttonFans.UseVisualStyleBackColor = false;
//
// SettingsForm
//
AutoScaleDimensions = new SizeF(13F, 32F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(728, 1079);
AutoScaleDimensions = new SizeF(96F, 96F);
AutoScaleMode = AutoScaleMode.Dpi;
ClientSize = new Size(365, 543);
Controls.Add(buttonFans);
Controls.Add(labelBattery);
Controls.Add(buttonKeyboardColor);
@@ -541,12 +541,12 @@
Controls.Add(trackBattery);
Controls.Add(checkStartup);
FormBorderStyle = FormBorderStyle.FixedSingle;
Margin = new Padding(4, 2, 4, 2);
Margin = new Padding(2, 1, 2, 1);
MaximizeBox = false;
MdiChildrenMinimizedAnchorBottom = false;
MinimizeBox = false;
Name = "SettingsForm";
Padding = new Padding(9, 11, 9, 11);
Padding = new Padding(4, 6, 4, 6);
ShowIcon = false;
StartPosition = FormStartPosition.CenterScreen;
Text = "G-Helper";

View File

@@ -17,6 +17,8 @@ namespace GHelper
static System.Timers.Timer aTimer = default!;
public string perfName;
Fans fans;
public SettingsForm()
@@ -66,7 +68,7 @@ namespace GHelper
SetTimer();
}
@@ -76,7 +78,8 @@ namespace GHelper
{
fans = new Fans();
fans.Show();
} else
}
else
{
fans.Close();
}
@@ -397,8 +400,6 @@ namespace GHelper
public void SetPerformanceMode(int PerformanceMode = ASUSWmi.PerformanceBalanced, bool notify = false)
{
string perfName;
buttonSilent.FlatAppearance.BorderSize = buttonInactive;
buttonBalanced.FlatAppearance.BorderSize = buttonInactive;
buttonTurbo.FlatAppearance.BorderSize = buttonInactive;

View File

@@ -33,7 +33,7 @@ public class Startup
var userId = WindowsIdentity.GetCurrent().Name;
Debug.WriteLine(strExeFilePath);
//Debug.WriteLine(strExeFilePath);
TaskDefinition td = TaskService.Instance.NewTask();
td.RegistrationInfo.Description = "GHelper Auto Start";
td.Triggers.Add(new LogonTrigger { UserId = userId, });