2025-04-30 16:52:48 +02:00
|
|
|
|
using Microsoft.Win32;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using Crapfixer;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Settings.Personalization
|
|
|
|
|
|
{
|
|
|
|
|
|
internal class ShowTaskViewButton : FeatureBase
|
|
|
|
|
|
{
|
|
|
|
|
|
private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced";
|
|
|
|
|
|
private const string valueName = "ShowTaskViewButton";
|
|
|
|
|
|
private const int recommendedValue = 0;
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetFeatureDetails()
|
|
|
|
|
|
{
|
|
|
|
|
|
return $"{keyName} | Value: {valueName} | Recommended: {recommendedValue} (Task View off – cleaner taskbar, unless you use it often)";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string ID()
|
|
|
|
|
|
{
|
|
|
|
|
|
return "Hide Task view button on taskbar";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string Info()
|
|
|
|
|
|
{
|
|
|
|
|
|
return "This feature will hide the Task view button on taskbar";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-06 17:09:07 +02:00
|
|
|
|
public override Task<bool> CheckFeature()
|
2025-04-30 16:52:48 +02:00
|
|
|
|
{
|
2025-05-06 17:09:07 +02:00
|
|
|
|
return Task.FromResult(
|
2025-04-30 16:52:48 +02:00
|
|
|
|
Utils.IntEquals(keyName, valueName, recommendedValue)
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override Task<bool> DoFeature()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
Registry.SetValue(keyName, valueName, 0, RegistryValueKind.DWord);
|
|
|
|
|
|
return Task.FromResult(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
Logger.Log("Code red in " + ex.Message, LogLevel.Error);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Task.FromResult(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool UndoFeature()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
Registry.SetValue(keyName, valueName, 1, RegistryValueKind.DWord);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
Logger.Log("Code red in " + ex.Message, LogLevel.Error);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|