Repository: xM4ddy/OFGB
Branch: main
Commit: a2f3ecf6a51f
Files: 11
Total size: 34.7 KB
Directory structure:
gitextract_qaid3s_9/
├── .gitignore
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── LICENSE
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── OFGB.csproj
├── OFGB.sln
├── README.md
└── dark.xaml
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
================================================
FILE: App.xaml
================================================
<Application x:Class="OFGB.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="dark.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
================================================
FILE: App.xaml.cs
================================================
using System.Windows;
namespace OFGB
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
================================================
FILE: AssemblyInfo.cs
================================================
using System.Windows;
[assembly: ThemeInfo(
ResourceDictionaryLocation.None,
ResourceDictionaryLocation.SourceAssembly
)]
================================================
FILE: LICENSE
================================================
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>
================================================
FILE: MainWindow.xaml
================================================
<Window x:Class="OFGB.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="#1E1E2E"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
Title="OFGB"
SizeToContent="WidthAndHeight">
<WindowChrome.WindowChrome>
<WindowChrome
CaptionHeight="32"
CornerRadius="0"
GlassFrameThickness="0"
UseAeroCaptionButtons="False" />
</WindowChrome.WindowChrome>
<Grid>
<Image Source="/Assets/OFGB.png" SnapsToDevicePixels="True" Panel.ZIndex="1" Margin="8,8,0,0" Height="16" VerticalAlignment="Top" HorizontalAlignment="Left" />
<Button Content="" x:Name="close" FontSize="10" Panel.ZIndex="1" Width="40" Click="Close" Height="32" WindowChrome.IsHitTestVisibleInChrome="True" />
<CheckBox x:Name="cb1" Margin="8,32,0,0" Checked="Checked" Unchecked="Unchecked" Content="Disable File Explorer Ads" />
<CheckBox x:Name="cb2" Margin="8,52,0,0" Checked="Checked" Unchecked="Unchecked" Content="Disable Lock Screen Tips and Ads" />
<CheckBox x:Name="cb3" Margin="8,72,0,0" Checked="Checked" Unchecked="Unchecked" Content="Disable Settings Ads" />
<CheckBox x:Name="cb4" Margin="8,92,0,0" Checked="Checked" Unchecked="Unchecked" Content="Disable General Tips and Ads" />
<CheckBox x:Name="cb5" Margin="8,112,0,0" Checked="Checked" Unchecked="Unchecked" Content="Disable "Finish Setup" Ads" />
<CheckBox x:Name="cb6" Margin="8,132,0,0" Checked="Checked" Unchecked="Unchecked" Content="Disable "Welcome Experience" Ads" />
<CheckBox x:Name="cb7" Margin="8,152,0,0" Checked="Checked" Unchecked="Unchecked" Content="Disable Personalized Ads" />
<CheckBox x:Name="cb8" Margin="8,172,0,0" Checked="Checked" Unchecked="Unchecked" Content="Disable "Tailored Experiences"" />
<CheckBox x:Name="cb9" Margin="8,192,0,0" Checked="Checked" Unchecked="Unchecked" Content="Disable Start Menu Ads" />
<CheckBox x:Name="cb10" Margin="8,212,0,0" Checked="Checked" Unchecked="Unchecked" Content="Disable "Notification Suggestions"" />
<Rectangle HorizontalAlignment="Stretch" Margin="8,234,8,0" Fill="Gray" Height="0.9" VerticalAlignment="Top" />
<TextBlock Foreground="#F5C2E7" Width="210" Margin="9,240,0,0" Text="These require running as admin."/>
<CheckBox x:Name="cb11" Margin="8,262,0,0" Checked="Checked" Unchecked="Unchecked" Content="Disable Bing Results In Search" />
<CheckBox x:Name="cb12" Margin="8,282,0,0" Checked="Checked" Unchecked="Unchecked" Padding="4,-1,10,23" Content="Disable Edge Search Bar Widget" />
<TextBlock Foreground="Gray" FontSize="12" HorizontalAlignment="Right" VerticalAlignment="Bottom" TextAlignment="Left" Margin="0,0,8,5" TextWrapping="Wrap" Text="v0.4"/>
</Grid>
</Window>
================================================
FILE: MainWindow.xaml.cs
================================================
using Microsoft.Win32;
using System;
using System.Windows;
using System.Windows.Interop;
using System.Runtime.InteropServices;
using System.Windows.Controls;
using System.Security.Principal;
namespace OFGB
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
[LibraryImport("dwmapi.dll", EntryPoint = "DwmSetWindowAttribute")]
internal static partial int DwmSetWindowAttribute(IntPtr hwnd, int attr, [In] int[] attrValue, int attrSize);
const string cur_ver = "Software\\Microsoft\\Windows\\CurrentVersion\\";
public MainWindow()
{
InitializeComponent();
InitializeKeys();
DwmSetWindowAttribute(new WindowInteropHelper(Application.Current.MainWindow).EnsureHandle(), 33, [2], sizeof(int));
}
private void InitializeKeys()
{
// Sync provider notifications in File Explorer
bool key1 = CreateKey(cur_ver + "Explorer\\Advanced", "ShowSyncProviderNotifications");
cb1.IsChecked = key1;
// Get fun facts, tips, tricks, and more on your lock screen
bool key2 = CreateKey(cur_ver + "ContentDeliveryManager", "RotatingLockScreenOverlayEnabled");
bool key3 = CreateKey(cur_ver + "ContentDeliveryManager", "SubscribedContent-338387Enabled");
cb2.IsChecked = key2 && key3;
// Show suggested content in Settings app
bool key4 = CreateKey(cur_ver + "ContentDeliveryManager", "SubscribedContent-338393Enabled");
bool key5 = CreateKey(cur_ver + "ContentDeliveryManager", "SubscribedContent-353694Enabled");
bool key6 = CreateKey(cur_ver + "ContentDeliveryManager", "SubscribedContent-353696Enabled");
cb3.IsChecked = key4 && key5 && key6;
// Get tips and suggestions when using Windows
bool key7 = CreateKey(cur_ver + "ContentDeliveryManager", "SubscribedContent-338389Enabled");
cb4.IsChecked = key7;
// Suggest ways to get the most out of Windows and finish setting up this device
bool key8 = CreateKey(cur_ver + "UserProfileEngagement", "ScoobeSystemSettingEnabled");
cb5.IsChecked = key8;
// Show me the Windows welcome experience after updates and occasionally when I sign in to highlight what's new and suggested
bool key9 = CreateKey(cur_ver + "ContentDeliveryManager", "SubscribedContent-310093Enabled");
cb6.IsChecked = key9;
// Let apps show me personalized ads by using my advertising ID
bool key10 = CreateKey(cur_ver + "AdvertisingInfo", "Enabled");
cb7.IsChecked = key10;
// Tailored experiences
bool key11 = CreateKey(cur_ver + "Privacy", "TailoredExperiencesWithDiagnosticDataEnabled");
cb8.IsChecked = key11;
// "Show recommendations for tips, shortcuts, new apps, and more" on Start
bool key12 = CreateKey(cur_ver + "Explorer\\Advanced", "Start_IrisRecommendations");
cb9.IsChecked = key12;
// "Turn off notifications from <app>? We noticed you haven't opened these in a while."
bool key13 = CreateKey(cur_ver + "Notifications\\Settings\\Windows.ActionCenter.SmartOptOut", "Enabled");
cb10.IsChecked = key13;
// These Need To Be Run As Administrator
if (IsRunningAsAdministrator())
{
// Show Bing Results in Windows Search (Inverted, 1 == Disabled)
bool key14 = CreateKey("Software\\Policies\\Microsoft\\Windows\\Explorer", "DisableSearchBoxSuggestions");
bool key15 = CreateKey(cur_ver + "Search", "BingSearchEnabled");
cb11.IsChecked = !key14 && key15;
// Disable Edge desktop search widget bar
bool key16 = CreateKey("Software\\Policies\\Microsoft\\Edge", "WebWidgetAllowed");
cb12.IsChecked = key16;
}
else
{
cb11.IsEnabled = false;
cb12.IsEnabled = false;
}
}
private static bool CreateKey(string loc, string key)
{
RegistryKey? keyRef;
bool value;
if (Registry.CurrentUser.OpenSubKey(loc, true) is not null)
{
keyRef = Registry.CurrentUser.OpenSubKey(loc, true);
}
else
{
keyRef = Registry.CurrentUser.CreateSubKey(loc);
keyRef.SetValue(key, 0);
}
if (keyRef is null)
{
MessageBox.Show("Failed to create a registry subkey during initialization!", "OFGB: Fatal Error", MessageBoxButton.OK, MessageBoxImage.Error);
throw new InvalidOperationException("OFGB: Failed to create subkey during initialization!");
}
value = Convert.ToBoolean(keyRef.GetValue(key));
keyRef.Close();
return value;
}
private static void ToggleOptions(string checkboxName, bool enable)
{
switch (checkboxName)
{
case "cb1":
Registry.SetValue("HKEY_CURRENT_USER\\" + cur_ver + "Explorer\\Advanced\\", "ShowSyncProviderNotifications", Convert.ToInt32(!enable));
break;
case "cb2":
Registry.SetValue("HKEY_CURRENT_USER\\" + cur_ver + "ContentDeliveryManager", "RotatingLockScreenOverlayEnabled", Convert.ToInt32(!enable));
Registry.SetValue("HKEY_CURRENT_USER\\" + cur_ver + "ContentDeliveryManager", "SubscribedContent-338387Enabled", Convert.ToInt32(!enable));
break;
case "cb3":
Registry.SetValue("HKEY_CURRENT_USER\\" + cur_ver + "ContentDeliveryManager", "SubscribedContent-338393Enabled", Convert.ToInt32(!enable));
Registry.SetValue("HKEY_CURRENT_USER\\" + cur_ver + "ContentDeliveryManager", "SubscribedContent-353694Enabled", Convert.ToInt32(!enable));
Registry.SetValue("HKEY_CURRENT_USER\\" + cur_ver + "ContentDeliveryManager", "SubscribedContent-353696Enabled", Convert.ToInt32(!enable));
break;
case "cb4":
Registry.SetValue("HKEY_CURRENT_USER\\" + cur_ver + "ContentDeliveryManager", "SubscribedContent-338389Enabled", Convert.ToInt32(!enable));
break;
case "cb5":
Registry.SetValue("HKEY_CURRENT_USER\\" + cur_ver + "UserProfileEngagement", "ScoobeSystemSettingEnabled", Convert.ToInt32(!enable));
break;
case "cb6":
Registry.SetValue("HKEY_CURRENT_USER\\" + cur_ver + "ContentDeliveryManager", "SubscribedContent-310093Enabled", Convert.ToInt32(!enable));
break;
case "cb7":
Registry.SetValue("HKEY_CURRENT_USER\\" + cur_ver + "AdvertisingInfo", "Enabled", Convert.ToInt32(!enable));
break;
case "cb8":
Registry.SetValue("HKEY_CURRENT_USER\\" + cur_ver + "Privacy", "TailoredExperiencesWithDiagnosticDataEnabled", Convert.ToInt32(!enable));
break;
case "cb9":
Registry.SetValue("HKEY_CURRENT_USER\\" + cur_ver + "Explorer\\Advanced", "Start_IrisRecommendations", Convert.ToInt32(!enable));
break;
case "cb10":
Registry.SetValue("HKEY_CURRENT_USER\\" + cur_ver + "Notifications\\Settings\\Windows.ActionCenter.SmartOptOut", "Enabled", Convert.ToInt32(!enable));
break;
case "cb11":
Registry.SetValue("HKEY_CURRENT_USER\\Software\\Policies\\Microsoft\\Windows\\Explorer", "DisableSearchBoxSuggestions", Convert.ToInt32(enable)); // <- Inverted
Registry.SetValue("HKEY_CURRENT_USER\\" + cur_ver + "Search", "BingSearchEnabled", Convert.ToInt32(!enable));
break;
case "cb12":
Registry.SetValue("HKEY_CURRENT_USER\\Software\\Policies\\Microsoft\\Edge", "WebWidgetAllowed", Convert.ToInt32(!enable));
break;
}
}
public static bool IsRunningAsAdministrator()
{
return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);
}
private void Checked(object sender, RoutedEventArgs e)
{
ToggleOptions(((CheckBox)sender).Name, true);
}
private void Unchecked(object sender, RoutedEventArgs e)
{
ToggleOptions(((CheckBox)sender).Name, false);
}
private void Close(object sender, RoutedEventArgs e)
{
Close();
}
}
}
================================================
FILE: OFGB.csproj
================================================
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows7.0</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
<ApplicationIcon>Assets\icon.ico</ApplicationIcon>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<SelfContained>true</SelfContained>
<DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<None Remove="Assets\OFGB.png" />
<None Remove="ofgb.png" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\icon.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="Assets\OFGB.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
</ItemGroup>
</Project>
================================================
FILE: OFGB.sln
================================================
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.6.33815.320
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OFGB", "OFGB.csproj", "{493D1790-F67D-45E3-9CD8-D880FB1E05E3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{493D1790-F67D-45E3-9CD8-D880FB1E05E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{493D1790-F67D-45E3-9CD8-D880FB1E05E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{493D1790-F67D-45E3-9CD8-D880FB1E05E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{493D1790-F67D-45E3-9CD8-D880FB1E05E3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {27FFC424-4579-463D-8E36-F5404D07E39B}
EndGlobalSection
EndGlobal
================================================
FILE: README.md
================================================
<p align="center">
<img src="https://i.ibb.co/ZYgBD06/ofgbF.png" alt="A screenshot of OFGB"/>
</p>
# OFGB (Oh Frick Go Back)
On April 23, 2024, Microsoft released an [update](https://support.microsoft.com/en-us/topic/april-23-2024-kb5036980-os-builds-22621-3527-and-22631-3527-preview-5a0d6c49-e42e-4eb4-8541-33a7139281ed) for Windows 11 that added ads all across the OS, including the File Explorer, Start Menu, and more. This tool changes certain keys in the [Windows Registry](https://en.wikipedia.org/wiki/Windows_Registry) to disable those ads. It's written in C# and uses [WPF](https://en.wikipedia.org/wiki/Windows_Presentation_Foundation).
## First things first, credits:
- [Registry keys, comments about their function](https://github.com/xM4ddy/OFGB/blob/92756276178137bb78d7c563733dde0d24f13aff/MainWindow.xaml.cs#L33) and the inspiration for this project were all from [Shawn Brink](https://www.elevenforum.com/members/brink.2/) and [his awesome script](https://www.elevenforum.com/t/disable-ads-in-windows-11.8004/).
- [A good bit of the theme used for the app](https://github.com/xM4ddy/OFGB/blob/main/dark.xaml) is from a cool project called [DarkNet](https://github.com/Aldaviva/DarkNet) by [Aldaviva](https://github.com/Aldaviva).
## Downloads
To download the latest version of OFGB, [click here](https://github.com/xM4ddy/OFGB/releases/latest) or click the "Releases" tab at the right of the page.
## Building
To build OFGB, you will need [Visual Studio](https://visualstudio.microsoft.com/) and the [.NET 8.0 SDK](https://dotnet.microsoft.com/download/dotnet/8.0).
1. Clone/download the repository, either with `git clone https://github.com/xM4ddy/OFGB` or by downloading the ZIP file.
2. Open the solution file in Visual Studio.
3. Build the solution by pressing `Ctrl + Shift + B` or by going to `Build > Build Solution`.
## Contributions
If you find any bugs or have any suggestions, feel free to [open an issue](https://github.com/xM4ddy/OFGB/issues) or [start a discussion](https://github.com/xM4ddy/OFGB/discussions).
## Other Notes
- Thanks for checking out the project, and for all of the support! ❤️
- GitHub is the only place I am sharing this program! I am not affiliated with any other websites that may share this app, thus I cannot guarantee the safety of any downloads from outside of GitHub.
- Want to avoid all this mess? Try Linux!
================================================
FILE: dark.xaml
================================================
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="labelStyleCommon" TargetType="Label">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="checkBoxStyleCommon" TargetType="CheckBox">
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Margin" Value="0,86,0,0" />
</Style>
<Style TargetType="{x:Type Button}">
<Setter Property="Foreground" Value="#757473" />
<Setter Property="Background" Value="#00000000" />
<Setter Property="FontFamily" Value="Segoe Fluent Icons" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="buttonBorder" Background="{TemplateBinding Background}"
BorderThickness="0.0" BorderBrush="Transparent">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="#5593FE" TargetName="buttonBorder" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#F5C2E7" />
<Setter Property="Foreground" Value="#1E1E2E" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#585B70" />
<Setter Property="Foreground" Value="#11111b" />
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
<Style TargetType="Label" BasedOn="{StaticResource labelStyleCommon}">
<Setter Property="Foreground" Value="White" />
</Style>
<Style x:Key="FocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" StrokeDashArray="1 2"
Stroke="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}"
SnapsToDevicePixels="true" StrokeThickness="1" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="OptionMarkFocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="14,0,0,0" StrokeDashArray="1 2"
Stroke="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}"
SnapsToDevicePixels="true" StrokeThickness="1" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<SolidColorBrush x:Key="OptionMark.Static.Background" Color="Transparent" />
<SolidColorBrush x:Key="OptionMark.Static.Border" Color="#585B70" />
<SolidColorBrush x:Key="OptionMark.Static.Glyph" Color="#F5C2E7" />
<SolidColorBrush x:Key="OptionMark.MouseOver.Background" Color="Transparent" />
<SolidColorBrush x:Key="OptionMark.MouseOver.Border" Color="#89B4FA" />
<SolidColorBrush x:Key="OptionMark.MouseOver.Glyph" Color="#f9c5eb" />
<SolidColorBrush x:Key="OptionMark.Pressed.Background" Color="Transparent" />
<SolidColorBrush x:Key="OptionMark.Pressed.Border" Color="#89B4FA" />
<SolidColorBrush x:Key="OptionMark.Pressed.Glyph" Color="#b791ad" />
<SolidColorBrush x:Key="OptionMark.Disabled.Background" Color="#585B70" />
<SolidColorBrush x:Key="OptionMark.Disabled.Foreground" Color="black" />
<SolidColorBrush x:Key="OptionMark.Disabled.Border" Color="Transparent" />
<SolidColorBrush x:Key="OptionMark.Disabled.Glyph" Color="#FF64505E" />
<Style TargetType="{x:Type CheckBox}" BasedOn="{StaticResource checkBoxStyleCommon}">
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
<Setter Property="Background" Value="{StaticResource OptionMark.Static.Background}" />
<Setter Property="BorderBrush" Value="{StaticResource OptionMark.Static.Border}" />
<Setter Property="Foreground" Value="#CDD6F4" />
<Setter Property="BorderThickness" Value="1.3" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<Grid x:Name="templateRoot" Background="Transparent" SnapsToDevicePixels="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border x:Name="checkBoxBorder" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="1"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<Grid x:Name="markGrid">
<Path x:Name="optionMark"
Data="F1 M 9.97498,1.22334L 4.6983,9.09834L 4.52164,9.09834L 0,5.19331L 1.27664,3.52165L 4.255,6.08833L 8.33331,1.52588e-005L 9.97498,1.22334 Z "
Fill="{StaticResource OptionMark.Static.Glyph}" Margin="1"
Opacity="0" Stretch="None" />
<Rectangle x:Name="indeterminateMark"
Fill="{StaticResource OptionMark.Static.Glyph}" Margin="2"
Opacity="0" />
</Grid>
</Border>
<ContentPresenter x:Name="contentPresenter" Grid.Column="1"
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}" RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="HasContent" Value="true">
<Setter Property="FocusVisualStyle"
Value="{StaticResource OptionMarkFocusVisual}" />
<Setter Property="Padding" Value="4, -1, 10, 0" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="checkBoxBorder"
Value="{StaticResource OptionMark.MouseOver.Background}" />
<Setter Property="BorderBrush" TargetName="checkBoxBorder"
Value="{StaticResource OptionMark.MouseOver.Border}" />
<Setter Property="Fill" TargetName="optionMark"
Value="{StaticResource OptionMark.MouseOver.Glyph}" />
<Setter Property="Fill" TargetName="indeterminateMark"
Value="{StaticResource OptionMark.MouseOver.Glyph}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="checkBoxBorder"
Value="{StaticResource OptionMark.Disabled.Background}" />
<Setter Property="BorderBrush" TargetName="checkBoxBorder"
Value="{StaticResource OptionMark.Disabled.Border}" />
<Setter Property="Fill" TargetName="optionMark"
Value="{StaticResource OptionMark.Disabled.Glyph}" />
<Setter Property="Fill" TargetName="indeterminateMark"
Value="{StaticResource OptionMark.Disabled.Glyph}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="checkBoxBorder"
Value="{StaticResource OptionMark.Pressed.Background}" />
<Setter Property="BorderBrush" TargetName="checkBoxBorder"
Value="{StaticResource OptionMark.Pressed.Border}" />
<Setter Property="Fill" TargetName="optionMark"
Value="{StaticResource OptionMark.Pressed.Glyph}" />
<Setter Property="Fill" TargetName="indeterminateMark"
Value="{StaticResource OptionMark.Pressed.Glyph}" />
</Trigger>
<Trigger Property="IsChecked" Value="true">
<Setter Property="Opacity" TargetName="optionMark" Value="1" />
<Setter Property="Opacity" TargetName="indeterminateMark" Value="0" />
</Trigger>
<Trigger Property="IsChecked" Value="{x:Null}">
<Setter Property="Opacity" TargetName="optionMark" Value="0" />
<Setter Property="Opacity" TargetName="indeterminateMark" Value="1" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
gitextract_qaid3s_9/ ├── .gitignore ├── App.xaml ├── App.xaml.cs ├── AssemblyInfo.cs ├── LICENSE ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── OFGB.csproj ├── OFGB.sln ├── README.md └── dark.xaml
SYMBOL INDEX (11 symbols across 2 files)
FILE: App.xaml.cs
class App (line 8) | public partial class App : Application
FILE: MainWindow.xaml.cs
class MainWindow (line 15) | public partial class MainWindow : Window
method DwmSetWindowAttribute (line 17) | [LibraryImport("dwmapi.dll", EntryPoint = "DwmSetWindowAttribute")]
method MainWindow (line 22) | public MainWindow()
method InitializeKeys (line 30) | private void InitializeKeys()
method CreateKey (line 94) | private static bool CreateKey(string loc, string key)
method ToggleOptions (line 121) | private static void ToggleOptions(string checkboxName, bool enable)
method IsRunningAsAdministrator (line 168) | public static bool IsRunningAsAdministrator()
method Checked (line 173) | private void Checked(object sender, RoutedEventArgs e)
method Unchecked (line 178) | private void Unchecked(object sender, RoutedEventArgs e)
method Close (line 183) | private void Close(object sender, RoutedEventArgs e)
Condensed preview — 11 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (38K chars).
[
{
"path": ".gitignore",
"chars": 6223,
"preview": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n##\n## G"
},
{
"path": "App.xaml",
"chars": 517,
"preview": "<Application x:Class=\"OFGB.App\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n "
},
{
"path": "App.xaml.cs",
"chars": 175,
"preview": "using System.Windows;\n\nnamespace OFGB\n{\n /// <summary>\n /// Interaction logic for App.xaml\n /// </summary>\n "
},
{
"path": "AssemblyInfo.cs",
"chars": 131,
"preview": "using System.Windows;\n\n[assembly: ThemeInfo(\n ResourceDictionaryLocation.None,\n ResourceDictionaryLocation.SourceA"
},
{
"path": "LICENSE",
"chars": 1211,
"preview": "This is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, c"
},
{
"path": "MainWindow.xaml",
"chars": 3202,
"preview": "<Window x:Class=\"OFGB.MainWindow\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xml"
},
{
"path": "MainWindow.xaml.cs",
"chars": 9010,
"preview": "using Microsoft.Win32;\nusing System;\nusing System.Windows;\nusing System.Windows.Interop;\nusing System.Runtime.InteropSe"
},
{
"path": "OFGB.csproj",
"chars": 889,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk\">\n <PropertyGroup>\n <OutputType>WinExe</OutputType>\n <TargetFramework>net8.0-win"
},
{
"path": "OFGB.sln",
"chars": 1084,
"preview": "Microsoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 17\nVisualStudioVersion = 17.6.33815."
},
{
"path": "README.md",
"chars": 2382,
"preview": "<p align=\"center\">\n <img src=\"https://i.ibb.co/ZYgBD06/ofgbF.png\" alt=\"A screenshot of OFGB\"/>\n</p>\n\n# OFGB (Oh Frick"
},
{
"path": "dark.xaml",
"chars": 10665,
"preview": "<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"http://schemas.micro"
}
]
About this extraction
This page contains the full source code of the xM4ddy/OFGB GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 11 files (34.7 KB), approximately 8.6k tokens, and a symbol index with 11 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.