mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7e8ba3241 | ||
|
|
b46f0fb887 |
@@ -16,7 +16,7 @@
|
|||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>0.24</AssemblyVersion>
|
<AssemblyVersion>0.25</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -485,7 +485,7 @@ public class NativeMethods
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var devices = GetAllDevices();
|
var devices = GetAllDevices().ToArray();
|
||||||
int count = 0, displayNum = -1;
|
int count = 0, displayNum = -1;
|
||||||
|
|
||||||
foreach (var device in devices)
|
foreach (var device in devices)
|
||||||
|
|||||||
@@ -144,6 +144,10 @@ namespace GHelper
|
|||||||
case PBT_APMRESUMEAUTOMATIC:
|
case PBT_APMRESUMEAUTOMATIC:
|
||||||
settingsForm.BeginInvoke(delegate
|
settingsForm.BeginInvoke(delegate
|
||||||
{
|
{
|
||||||
|
// Fix for bugging buios on wake up
|
||||||
|
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, (config.getConfig("performance_mode")+1) % 3);
|
||||||
|
Thread.Sleep(500);
|
||||||
|
|
||||||
SetAutoModes();
|
SetAutoModes();
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1028,7 +1028,9 @@ namespace GHelper
|
|||||||
|
|
||||||
public void SetStartupCheck(bool status)
|
public void SetStartupCheck(bool status)
|
||||||
{
|
{
|
||||||
|
checkStartup.CheckedChanged -= CheckStartup_CheckedChanged;
|
||||||
checkStartup.Checked = status;
|
checkStartup.Checked = status;
|
||||||
|
checkStartup.CheckedChanged += CheckStartup_CheckedChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetBatteryChargeLimit(int limit)
|
public void SetBatteryChargeLimit(int limit)
|
||||||
|
|||||||
15
Startup.cs
15
Startup.cs
@@ -22,16 +22,25 @@ public class Startup
|
|||||||
|
|
||||||
var userId = WindowsIdentity.GetCurrent().Name;
|
var userId = WindowsIdentity.GetCurrent().Name;
|
||||||
|
|
||||||
//Debug.WriteLine(strExeFilePath);
|
|
||||||
TaskDefinition td = TaskService.Instance.NewTask();
|
TaskDefinition td = TaskService.Instance.NewTask();
|
||||||
td.RegistrationInfo.Description = "GHelper Auto Start";
|
td.RegistrationInfo.Description = "GHelper Auto Start";
|
||||||
td.Triggers.Add(new LogonTrigger { UserId = userId, });
|
td.Triggers.Add(new LogonTrigger { UserId = userId });
|
||||||
td.Actions.Add(strExeFilePath);
|
td.Actions.Add(strExeFilePath);
|
||||||
|
|
||||||
td.Settings.StopIfGoingOnBatteries = false;
|
td.Settings.StopIfGoingOnBatteries = false;
|
||||||
td.Settings.DisallowStartIfOnBatteries = false;
|
td.Settings.DisallowStartIfOnBatteries = false;
|
||||||
|
|
||||||
TaskService.Instance.RootFolder.RegisterTaskDefinition(taskName, td);
|
Debug.WriteLine(strExeFilePath);
|
||||||
|
Debug.WriteLine(userId);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
TaskService.Instance.RootFolder.RegisterTaskDefinition(taskName, td);
|
||||||
|
} catch
|
||||||
|
{
|
||||||
|
MessageBox.Show("Can't schedule task", "Scheduler Error", MessageBoxButtons.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UnSchedule()
|
public static void UnSchedule()
|
||||||
|
|||||||
Reference in New Issue
Block a user