mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Dynamic lighting detection
This commit is contained in:
24
app/Helpers/DynamicLightingHelper.cs
Normal file
24
app/Helpers/DynamicLightingHelper.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace GHelper.Helpers
|
||||
{
|
||||
public static class DynamicLightingHelper
|
||||
{
|
||||
|
||||
public static bool IsEnabled()
|
||||
{
|
||||
using var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Lighting");
|
||||
var registryValueObject = key?.GetValue("AmbientLightingEnabled");
|
||||
|
||||
if (registryValueObject == null) return true;
|
||||
return (int)registryValueObject > 0;
|
||||
}
|
||||
|
||||
public static void OpenSettings()
|
||||
{
|
||||
ProcessHelper.RunCMD("explorer","ms-settings:personalization-lighting");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user