mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-09-04 00:05:27 +00:00
Fixed Issue 73.
This commit is contained in:
@@ -38,6 +38,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using System.Security.Principal;
|
using System.Security.Principal;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
@@ -73,6 +74,9 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
|
|
||||||
if (scheduler != null) {
|
if (scheduler != null) {
|
||||||
try {
|
try {
|
||||||
|
// check if the taskscheduler is running
|
||||||
|
IRunningTaskCollection collection = scheduler.GetRunningTasks(0);
|
||||||
|
|
||||||
ITaskFolder folder = scheduler.GetFolder("\\Open Hardware Monitor");
|
ITaskFolder folder = scheduler.GetFolder("\\Open Hardware Monitor");
|
||||||
IRegisteredTask task = folder.GetTask("Startup");
|
IRegisteredTask task = folder.GetTask("Startup");
|
||||||
startup = (task != null) &&
|
startup = (task != null) &&
|
||||||
@@ -90,6 +94,8 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
startup = false;
|
startup = false;
|
||||||
} catch (UnauthorizedAccessException) {
|
} catch (UnauthorizedAccessException) {
|
||||||
scheduler = null;
|
scheduler = null;
|
||||||
|
} catch (COMException) {
|
||||||
|
scheduler = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
Reference in New Issue
Block a user