├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── TaskbarCustomizer.sln └── TaskbarCustomizer ├── App.config ├── App.xaml ├── App.xaml.cs ├── Helpers ├── DebugLogger.cs └── Utility.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── Resources └── icon.ico ├── TaskSettings └── Settings.cs ├── TaskbarCustomizer.csproj └── Taskbars ├── Elements └── TaskbarElement.cs └── Taskbar.cs /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 JustIntroverted 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## What is this? 2 | This is an application that allows you to manipulate certain aspects of the Taskbar on Windows 10. You can change if the Start button is visible, and you can change whether the Show Desktop button is visible. Along with those nifty features, you can also change the positioning of all pinned Taskbar items, and the position of the IconTray and Clock. 3 | 4 | ![TaskbarCustomizer](https://i.imgur.com/RFzCsap.jpg) 5 | ![TaskbarCustomizer](https://i.imgur.com/8RuZPv9.png) -------------------------------------------------------------------------------- /TaskbarCustomizer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TaskbarCustomizer", "TaskbarCustomizer\TaskbarCustomizer.csproj", "{29CB6913-DAAA-4ABA-B25A-B2D58521ED42}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {29CB6913-DAAA-4ABA-B25A-B2D58521ED42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {29CB6913-DAAA-4ABA-B25A-B2D58521ED42}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {29CB6913-DAAA-4ABA-B25A-B2D58521ED42}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {29CB6913-DAAA-4ABA-B25A-B2D58521ED42}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {F0F07470-945D-452D-83DB-FC5A75B1B725} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /TaskbarCustomizer/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TaskbarCustomizer/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | -------------------------------------------------------------------------------- /TaskbarCustomizer/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace TaskbarCustomizer { 4 | 5 | /// 6 | /// Interaction logic for App.xaml 7 | /// 8 | public partial class App : Application { 9 | } 10 | } -------------------------------------------------------------------------------- /TaskbarCustomizer/Helpers/DebugLogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace TaskbarCustomizer.Helpers 5 | { 6 | public class DebugLogger 7 | { 8 | private const string FILE_NAME = "debug.log"; 9 | private bool LogExists => File.Exists(FILE_NAME); 10 | 11 | public void AppendLog(Exception exception) 12 | { 13 | if (LogExists) 14 | { 15 | using (StreamWriter sw = new StreamWriter(FILE_NAME)) 16 | { 17 | sw.WriteLine(exception); 18 | } 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /TaskbarCustomizer/Helpers/Utility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace TaskbarCustomizer.Helpers 5 | { 6 | 7 | public class Utility 8 | { 9 | public delegate void WinEventDelegate(IntPtr hWinEventHook, uint eventType, 10 | IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime); 11 | 12 | public enum ABM : uint 13 | { 14 | New = 0x00000000, 15 | Remove = 0x00000001, 16 | QueryPos = 0x00000002, 17 | SetPos = 0x00000003, 18 | GetState = 0x00000004, 19 | GetTaskbarPos = 0x00000005, 20 | Activate = 0x00000006, 21 | GetAutoHideBar = 0x00000007, 22 | SetAutoHideBar = 0x00000008, 23 | WindowPosChanged = 0x00000009, 24 | SetState = 0x0000000A, 25 | } 26 | 27 | public const int WM_SIZE = 0x0005; 28 | 29 | public enum ABE : uint 30 | { 31 | Left = 0, 32 | Top = 1, 33 | Right = 2, 34 | Bottom = 3 35 | } 36 | 37 | public static class ABS 38 | { 39 | public const int Autohide = 0x0000001; 40 | public const int AlwaysOnTop = 0x0000002; 41 | } 42 | 43 | public const short SWP_NOMOVE = 0X2; 44 | public const short SWP_NOSIZE = 1; 45 | public const short SWP_NOZORDER = 0X4; 46 | public const short SWP_SHOWWINDOW = 0x0040; 47 | public const short SWP_NOACTIVATE = 0x0010; 48 | 49 | public const int SW_HIDE = 0; 50 | public const int SW_SHOW = 1; 51 | 52 | [DllImport("shell32.dll", SetLastError = true)] 53 | public static extern IntPtr SHAppBarMessage(ABM dwMessage, [In] ref APPBARDATA pData); 54 | 55 | [DllImport("user32.dll", SetLastError = true)] 56 | public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); 57 | 58 | [DllImport("user32.dll", CharSet = CharSet.Unicode)] 59 | public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle); 60 | 61 | [DllImport("user32.dll", SetLastError = true)] 62 | public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint); 63 | 64 | [DllImport("user32.dll", EntryPoint = "SetWindowPos")] 65 | public static extern IntPtr SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int Y, int cx, int cy, int wFlags); 66 | 67 | [DllImport("user32.dll")] 68 | public static extern int ShowWindow(IntPtr hwnd, int command); 69 | 70 | [DllImport("user32.dll", SetLastError = true)] 71 | public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId); 72 | 73 | [DllImport("user32.dll")] 74 | public static extern int SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam, IntPtr lParam); 75 | 76 | [DllImport("user32.dll")] 77 | [return: MarshalAs(UnmanagedType.Bool)] 78 | public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect); 79 | 80 | [DllImport("user32.dll")] 81 | [return: MarshalAs(UnmanagedType.Bool)] 82 | public static extern bool IsWindowVisible(IntPtr hWnd); 83 | 84 | [DllImport("user32.dll")] 85 | public static extern int SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttributeData data); 86 | 87 | [DllImport("user32.dll")] 88 | public static extern IntPtr SetWinEventHook(uint eventMin, uint eventMax, IntPtr 89 | hmodWinEventProc, WinEventDelegate lpfnWinEventProc, uint idProcess, 90 | uint idThread, uint dwFlags); 91 | 92 | [DllImport("user32.dll")] 93 | public static extern bool UnhookWinEvent(IntPtr hWinEventHook); 94 | 95 | public const uint EVENT_MIN = 0x00000001; 96 | public const uint EVENT_MAX = 0x7FFFFFFF; 97 | public const uint WINEVENT_OUTOFCONTEXT = 0; 98 | public const uint WINEVENT_SKIPOWNPROCESS = 0x0002; 99 | public const uint EVENT_OBJECT_LOCATIONCHANGE = 0x800B; 100 | 101 | public const uint WM_DWMCOLORIZATIONCOLORCHANGED = 0x0320; 102 | public const uint WM_WINDOWPOSCHANGED = 0x47; 103 | public const uint WM_PAINT = 0x000F; 104 | public const uint WM_CHANGEUISTATE = 0x127; 105 | public const uint WM_STYLECHANGED = 0x007D; 106 | 107 | [StructLayout(LayoutKind.Sequential)] 108 | public struct RECT 109 | { 110 | public int Left; // x position of upper-left corner 111 | public int Top; // y position of upper-left corner 112 | public int Right; // x position of lower-right corner 113 | public int Bottom; // y position of lower-right corner 114 | } 115 | 116 | [StructLayout(LayoutKind.Sequential)] 117 | public struct APPBARDATA 118 | { 119 | public uint cbSize; 120 | public IntPtr hWnd; 121 | public uint uCallbackMessage; 122 | public ABE uEdge; 123 | public RECT rc; 124 | public int lParam; 125 | } 126 | 127 | [StructLayout(LayoutKind.Sequential)] 128 | public struct WindowCompositionAttributeData 129 | { 130 | public WindowCompositionAttribute Attribute; 131 | public IntPtr Data; 132 | public int SizeOfData; 133 | } 134 | 135 | public enum WindowCompositionAttribute 136 | { 137 | 138 | // ... 139 | WCA_ACCENT_POLICY = 19 140 | 141 | // ... 142 | } 143 | 144 | public enum AccentState 145 | { 146 | ACCENT_DISABLED = 0, 147 | ACCENT_ENABLE_GRADIENT = 1, 148 | ACCENT_ENABLE_TRANSPARENTGRADIENT = 2, 149 | ACCENT_ENABLE_BLURBEHIND = 3, 150 | ACCENT_INVALID_STATE = 4 151 | } 152 | 153 | [StructLayout(LayoutKind.Sequential)] 154 | public struct AccentPolicy 155 | { 156 | public AccentState AccentState; 157 | public int AccentFlags; 158 | public int GradientColor; 159 | public int AnimationId; 160 | } 161 | 162 | public static IntPtr FindWindowByIndex(IntPtr hWndParent, string className, int index) 163 | { 164 | if (index == 0) 165 | return hWndParent; 166 | else 167 | { 168 | int ct = 0; 169 | IntPtr result = IntPtr.Zero; 170 | do 171 | { 172 | result = Utility.FindWindowEx(hWndParent, result, className, null); 173 | if (result != IntPtr.Zero) 174 | ++ct; 175 | } 176 | while (ct < index && result != IntPtr.Zero); 177 | return result; 178 | } 179 | } 180 | } 181 | } -------------------------------------------------------------------------------- /TaskbarCustomizer/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 |