-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I built this as a quick and dirty way to remove the buttons, so this was never in source control to begin with, hence the big dump of initial code.
- Loading branch information
Showing
16 changed files
with
2,031 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 2013 | ||
VisualStudioVersion = 12.0.21005.1 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Win10TaskbarCleaner", "Win10TaskbarCleaner\Win10TaskbarCleaner.csproj", "{C6C170EE-124A-45D8-B246-FB18B5908FC3}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{C6C170EE-124A-45D8-B246-FB18B5908FC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{C6C170EE-124A-45D8-B246-FB18B5908FC3}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{C6C170EE-124A-45D8-B246-FB18B5908FC3}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{C6C170EE-124A-45D8-B246-FB18B5908FC3}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> | ||
</startup> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Application x:Class="Win10TaskbarCleaner.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
|
||
namespace Win10TaskbarCleaner | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Window x:Class="Win10TaskbarCleaner.MainWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
Loaded="Window_Loaded" WindowState="Normal" ResizeMode="NoResize" | ||
Title="Windows 10 Task Bar Cleaner (for Technical Preview) v0.1 alpha for Enterprising Individuals Pro" Height="350" Width="525" Icon="PropertyIcon.ico"> | ||
<Grid> | ||
<TextBlock TextWrapping="Wrap" Margin="10,10,10,191">Windows 10 TP ships with 2 irremovable buttons on the TaskBar - Search and "Task View" (i.e. Win+Tab in a button). Until an option to remove the buttons lands in the OS you can use this utility to remove the buttons. Click Install below and you should be done!<LineBreak/><LineBreak/>Note: The TaskBar likes to readjust its controls every now and then so you may occasionally see your controls jump back and forth.</TextBlock> | ||
<TextBlock Margin="10,288,431,10"><Hyperlink NavigateUri="https://github.com/nachmore/Win10TaskbarCleaner" RequestNavigate="Hyperlink_RequestNavigate">Project Site</Hyperlink></TextBlock> | ||
<Button Name="btnInstall" Margin="154,174,154,75" Click="btnInstall_Click"></Button> | ||
<Button Content="Try it out" Name="btnCleanNow" Margin="376,267,27,10" Click="btnCleanNow_Click"></Button> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
using Microsoft.Win32; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Navigation; | ||
using System.Windows.Shapes; | ||
|
||
namespace Win10TaskbarCleaner | ||
{ | ||
/// <summary> | ||
/// Interaction logic for MainWindow.xaml | ||
/// </summary> | ||
public partial class MainWindow : Window | ||
{ | ||
private const string REG_APPNAME = "Win10TasbarCleaner"; | ||
|
||
private bool _installed = false; | ||
RegistryKey _regRun = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); | ||
|
||
public MainWindow() | ||
{ | ||
InitializeComponent(); | ||
|
||
var args = Environment.GetCommandLineArgs(); | ||
|
||
if (args.Count() > 1 && args[1].Contains("justrun")) | ||
{ | ||
Hide(); | ||
} | ||
} | ||
|
||
private void StartHiding() | ||
{ | ||
WorkScheduler sched = new WorkScheduler(); | ||
sched.Schedule(5000, TaskbarCleaner.HideButtons); | ||
|
||
Hide(); | ||
} | ||
|
||
private void Window_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
_installed = IsInstalled(); | ||
|
||
UpdateButton(); | ||
} | ||
|
||
private void UpdateButton() | ||
{ | ||
btnInstall.Content = (_installed ? "Uninstall" : "Install & Close"); | ||
} | ||
|
||
private bool IsInstalled() | ||
{ | ||
return (_regRun.GetValue(REG_APPNAME) != null); | ||
} | ||
|
||
private void btnInstall_Click(object sender, RoutedEventArgs e) | ||
{ | ||
if (_installed) | ||
Uninstall(); | ||
else | ||
InstallAndClose(); | ||
} | ||
|
||
private void Uninstall() | ||
{ | ||
_regRun.DeleteValue(REG_APPNAME); | ||
|
||
_installed = false; | ||
UpdateButton(); | ||
} | ||
|
||
private void InstallAndClose() | ||
{ | ||
_regRun.SetValue(REG_APPNAME, System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName + " /justrun"); | ||
|
||
_installed = true; | ||
|
||
StartHiding(); | ||
} | ||
|
||
private void btnCleanNow_Click(object sender, RoutedEventArgs e) | ||
{ | ||
TaskbarCleaner.HideButtons(); | ||
} | ||
|
||
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) | ||
{ | ||
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); | ||
e.Handled = true; | ||
} | ||
} | ||
} |
Oops, something went wrong.