├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── README.md ├── WinSlap.sln └── WinSlap ├── App.config ├── Coffee.Designer.cs ├── Coffee.cs ├── Coffee.resx ├── GlobalSuppressions.cs ├── Globals.cs ├── HardwareInfo.cs ├── MainForm.Designer.cs ├── MainForm.cs ├── MainForm.resx ├── Program.cs ├── ProgressReport.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── Resources ├── StartMenuLayout ├── StartMenuLayout.xml ├── coffee-cup-svgrepo-com.png ├── coffee-cup-svgrepo-com1.png ├── delapps.ps1 ├── photoviewer.ps1 ├── preventpreinstallingapps.ps1 ├── startlayout ├── startlayout.reg └── updateapps.ps1 ├── SlapForm.Designer.cs ├── SlapForm.cs ├── SlapForm.resx ├── Slapper.cs ├── WinAPI.cs ├── WinSlap.csproj ├── WinSlap.csproj.DotSettings ├── app.manifest └── packages.config /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: svenmauch 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # JustCode is a .NET coding add-in 131 | .JustCode 132 | 133 | # TeamCity is a build add-in 134 | _TeamCity* 135 | 136 | # DotCover is a Code Coverage Tool 137 | *.dotCover 138 | 139 | # AxoCover is a Code Coverage Tool 140 | .axoCover/* 141 | !.axoCover/settings.json 142 | 143 | # Visual Studio code coverage results 144 | *.coverage 145 | *.coveragexml 146 | 147 | # NCrunch 148 | _NCrunch_* 149 | .*crunch*.local.xml 150 | nCrunchTemp_* 151 | 152 | # MightyMoose 153 | *.mm.* 154 | AutoTest.Net/ 155 | 156 | # Web workbench (sass) 157 | .sass-cache/ 158 | 159 | # Installshield output folder 160 | [Ee]xpress/ 161 | 162 | # DocProject is a documentation generator add-in 163 | DocProject/buildhelp/ 164 | DocProject/Help/*.HxT 165 | DocProject/Help/*.HxC 166 | DocProject/Help/*.hhc 167 | DocProject/Help/*.hhk 168 | DocProject/Help/*.hhp 169 | DocProject/Help/Html2 170 | DocProject/Help/html 171 | 172 | # Click-Once directory 173 | publish/ 174 | 175 | # Publish Web Output 176 | *.[Pp]ublish.xml 177 | *.azurePubxml 178 | # Note: Comment the next line if you want to checkin your web deploy settings, 179 | # but database connection strings (with potential passwords) will be unencrypted 180 | *.pubxml 181 | *.publishproj 182 | 183 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 184 | # checkin your Azure Web App publish settings, but sensitive information contained 185 | # in these scripts will be unencrypted 186 | PublishScripts/ 187 | 188 | # NuGet Packages 189 | *.nupkg 190 | # NuGet Symbol Packages 191 | *.snupkg 192 | # The packages folder can be ignored because of Package Restore 193 | **/[Pp]ackages/* 194 | # except build/, which is used as an MSBuild target. 195 | !**/[Pp]ackages/build/ 196 | # Uncomment if necessary however generally it will be regenerated when needed 197 | #!**/[Pp]ackages/repositories.config 198 | # NuGet v3's project.json files produces more ignorable files 199 | *.nuget.props 200 | *.nuget.targets 201 | 202 | # Microsoft Azure Build Output 203 | csx/ 204 | *.build.csdef 205 | 206 | # Microsoft Azure Emulator 207 | ecf/ 208 | rcf/ 209 | 210 | # Windows Store app package directories and files 211 | AppPackages/ 212 | BundleArtifacts/ 213 | Package.StoreAssociation.xml 214 | _pkginfo.txt 215 | *.appx 216 | *.appxbundle 217 | *.appxupload 218 | 219 | # Visual Studio cache files 220 | # files ending in .cache can be ignored 221 | *.[Cc]ache 222 | # but keep track of directories ending in .cache 223 | !?*.[Cc]ache/ 224 | 225 | # Others 226 | ClientBin/ 227 | ~$* 228 | *~ 229 | *.dbmdl 230 | *.dbproj.schemaview 231 | *.jfm 232 | *.pfx 233 | *.publishsettings 234 | orleans.codegen.cs 235 | 236 | # Including strong name files can present a security risk 237 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 238 | #*.snk 239 | 240 | # Since there are multiple workflows, uncomment next line to ignore bower_components 241 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 242 | #bower_components/ 243 | 244 | # RIA/Silverlight projects 245 | Generated_Code/ 246 | 247 | # Backup & report files from converting an old project file 248 | # to a newer Visual Studio version. Backup files are not needed, 249 | # because we have git ;-) 250 | _UpgradeReport_Files/ 251 | Backup*/ 252 | UpgradeLog*.XML 253 | UpgradeLog*.htm 254 | ServiceFabricBackup/ 255 | *.rptproj.bak 256 | 257 | # SQL Server files 258 | *.mdf 259 | *.ldf 260 | *.ndf 261 | 262 | # Business Intelligence projects 263 | *.rdl.data 264 | *.bim.layout 265 | *.bim_*.settings 266 | *.rptproj.rsuser 267 | *- [Bb]ackup.rdl 268 | *- [Bb]ackup ([0-9]).rdl 269 | *- [Bb]ackup ([0-9][0-9]).rdl 270 | 271 | # Microsoft Fakes 272 | FakesAssemblies/ 273 | 274 | # GhostDoc plugin setting file 275 | *.GhostDoc.xml 276 | 277 | # Node.js Tools for Visual Studio 278 | .ntvs_analysis.dat 279 | node_modules/ 280 | 281 | # Visual Studio 6 build log 282 | *.plg 283 | 284 | # Visual Studio 6 workspace options file 285 | *.opt 286 | 287 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 288 | *.vbw 289 | 290 | # Visual Studio LightSwitch build output 291 | **/*.HTMLClient/GeneratedArtifacts 292 | **/*.DesktopClient/GeneratedArtifacts 293 | **/*.DesktopClient/ModelManifest.xml 294 | **/*.Server/GeneratedArtifacts 295 | **/*.Server/ModelManifest.xml 296 | _Pvt_Extensions 297 | 298 | # Paket dependency manager 299 | .paket/paket.exe 300 | paket-files/ 301 | 302 | # FAKE - F# Make 303 | .fake/ 304 | 305 | # CodeRush personal settings 306 | .cr/personal 307 | 308 | # Python Tools for Visual Studio (PTVS) 309 | __pycache__/ 310 | *.pyc 311 | 312 | # Cake - Uncomment if you are using it 313 | # tools/** 314 | # !tools/packages.config 315 | 316 | # Tabs Studio 317 | *.tss 318 | 319 | # Telerik's JustMock configuration file 320 | *.jmconfig 321 | 322 | # BizTalk build output 323 | *.btp.cs 324 | *.btm.cs 325 | *.odx.cs 326 | *.xsd.cs 327 | 328 | # OpenCover UI analysis results 329 | OpenCover/ 330 | 331 | # Azure Stream Analytics local run output 332 | ASALocalRun/ 333 | 334 | # MSBuild Binary and Structured Log 335 | *.binlog 336 | 337 | # NVidia Nsight GPU debugger configuration file 338 | *.nvuser 339 | 340 | # MFractors (Xamarin productivity tool) working folder 341 | .mfractor/ 342 | 343 | # Local History for Visual Studio 344 | .localhistory/ 345 | 346 | # BeatPulse healthcheck temp database 347 | healthchecksdb 348 | 349 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 350 | MigrationBackup/ 351 | 352 | # Ionide (cross platform F# VS Code tools) working folder 353 | .ionide/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WinSlap 2 | 3 | Swiftly configure a fresh Windows 10 installation with useful tweaks and antispy settings. 4 | 5 |

6 | WinSlap v1.7 7 |

8 | 9 | WinSlap is primarily developed for my own use cases. Feel free to use it under any terms the license permits. However, I can not guarantee that it works as intended, doesn't break your system or is actively maintained. 10 | 11 | ## Goals 12 | 13 | 1. Apply tweaks to a fresh installation of Windows 10 after using a clean retail image (if you're looking to apply tweaks during installation, check out image creation tools) 14 | 2. No bloat. WinSlap does what it's features list says and nothing else. 15 | 16 | ## Note 17 | 18 | WinSlap is currently developed for and tested against **Windows 10 Pro 22H2 (64-bit)** on single-user systems. While it should work on older versions and can work on newer versions or multi-user systems, I have not tested it myself. 19 | 20 | ## Features 21 | 22 | ### Tweaks 23 | 24 | - Disable Shared Experiences 25 | - Disable Cortana 26 | - Disable Game DVR and Game Bar 27 | - Disable Hotspot 2.0 28 | - Don't include frequently used folders in Quick access 29 | - Don't show sync provider notifications 30 | - Disable Sharing Wizard 31 | - Show 'This PC' when launching File Explorer 32 | - Disable Telemetry 33 | - Uninstall OneDrive 34 | - Disable Activity History 35 | - Disable automatically installing Apps 36 | - Disable Feedback dialogs 37 | - Disable Start Menu suggestions 38 | - Disable Bing search 39 | - Disable password reveal button 40 | - Disable settings sync 41 | - Disable startup sound 42 | - Disable autostart startup delay 43 | - Disable location 44 | - Disable Advertising ID 45 | - Disable Malware Removal Tool data reporting 46 | - Disable sending typing info to Microsoft 47 | - Disable Personalization 48 | - Hide language list from websites 49 | - Disable Miracast 50 | - Disable App Diagnostics 51 | - Disable Wi-Fi Sense 52 | - Disable lock screen Spotlight 53 | - Disable automatic maps updates 54 | - Disable error reporting 55 | - Disable Remote Assistance 56 | - Use UTC as BIOS time 57 | - Hide network from lock screen 58 | - Disable sticky keys prompt 59 | - Hide 3D Objects from File Explorer 60 | - Remove preinstalled apps except Photos, Calculator, Store 61 | - Update Windows Store Apps 62 | - Prevent preinstalling apps for new users 63 | - Unpin preinstalled apps 64 | - Disable Smart Screen 65 | - Disable Smart Glass 66 | - Remove Intel Control Panel from context menus 67 | - Remove NVIDIA Control Panel from context menus 68 | - Remove AMD Control Panel from context menus 69 | - Disable suggested apps in Windows Ink Workspace 70 | - Disable experiments by Microsoft 71 | - Disable Inventory Collection 72 | - Disable Steps Recorder 73 | - Disable Application Compatibility Engine 74 | - Disable pre-release features and settings 75 | - Disable camera on lock screen 76 | - Disable Microsoft Edge first run page 77 | - Disable Microsoft Edge preload 78 | - Install .NET Framework 2.0, 3.0 and 3.5 79 | - Enable Windows Photo Viewer 80 | - Uninstall Microsoft XPS Document Writer 81 | - Disable security questions for local accounts 82 | - Disable app suggestions (e.g. use Edge instead of Firefox) 83 | - Remove default Fax printer 84 | - Remove Microsoft XPS Document Writer 85 | - Disable clipboard history 86 | - Disable cloud sync of clipboard history 87 | - Disable automatic update of speech data 88 | - Disable handwriting error reports 89 | - Disable cloud sync of text messages 90 | - Disable Bluetooth advertisements 91 | - Disable Windows Media DRM internet access 92 | - Disable Get even more out of Windows screen 93 | - Set power plan to high performance 94 | - Disable notifications on the lock screen 95 | - Disable reminders and incoming VoIP calls on the lock screen 96 | - Disable Windows welcome experience 97 | - Disable Aero Shake 98 | - Disable suggestions in timeline 99 | - Disable typing insights 100 | - Disable spell checker 101 | - Disable text suggestions on the software keyboard 102 | - Disable SafeSearch 103 | - Disable suggested content in settings app 104 | - Disable automatic login after finishing updates 105 | - Disable Windows Defender submitting sample files 106 | 107 | ### Appearance 108 | 109 | - Add This PC shortcut to desktop 110 | - Small taskbar icons 111 | - Don't group tasks in taskbar 112 | - Hide Taskview button in taskbar 113 | - Hide People button in taskbar 114 | - Hide search bar in taskbar 115 | - Remove compatibility item from context menu 116 | - Hide OneDrive Cloud states in File Explorer 117 | - Always show file name extensions 118 | - Remove OneDrive from File Explorer 119 | - Delete quicklaunch items 120 | - Use Windows 7 volume control 121 | - Remove Microsoft Edge desktop shortcut 122 | - Disable Lockscreen Blur 123 | - Hide Meet Now icon in taskbar 124 | - Hide News and interests in taskbar 125 | 126 | ### Software 127 | 128 | - Install 7Zip 129 | - Install Adobe Acrobat Reader DC 130 | - Install Audacity 131 | - Install BalenaEtcher 132 | - Install calibre 133 | - Install CPU-Z 134 | - Install DupeGuru 135 | - Install EarTrumpet 136 | - Install Epic Games Launcher 137 | - Install GIMP 138 | - Install GPU-Z 139 | - Install Git 140 | - Install Google Chrome 141 | - Install Inkscape 142 | - Install Irfanview 143 | - Install Java Runtime Environment 144 | - Install KeePassXC 145 | - Install LibreOffice 146 | - Install Minecraft 147 | - Install Mozilla Firefox 148 | - Install Mozilla Thunderbird 149 | - Install Nextcloud Desktop 150 | - Install Notepad++ 151 | - Install OBS Studio 152 | - Install OpenHashTab 153 | - Install OpenVPN Connect 154 | - Install PowerToys 155 | - Install PuTTY 156 | - Install Python 157 | - Install Slack 158 | - Install Speccy 159 | - Install Steam 160 | - Install TeamViewer 161 | - Install TeamSpeak 162 | - Install Telegram 163 | - Install Ubisoft Connect 164 | - Install VirtualBox 165 | - Install VLC media player 166 | - Install WinRAR 167 | - Install WinSCP 168 | - Install Windows Terminal 169 | - Install Wireguard 170 | - Install Wireshark 171 | - Install Zoom 172 | 173 | ### Advanced 174 | 175 | - Disable Background Apps 176 | - Precision Trackpad: Disable keyboard block after clicking 177 | - Disable Windows Defender 178 | - Disable Link-local Multicast Name Resolution 179 | - Disable Smart Multi-Homed Name Resolution 180 | - Disable Web Proxy Auto-Discovery 181 | - Disable Teredo tunneling 182 | - Disable Intra-Site Automatic Tunnel Addressing Protocol 183 | - Enable Windows Subsystem for Linux 184 | - Uninstall Internet Explorer 185 | - Enable Storage Sense 186 | - Disable fast startup 187 | - Disable mouse pointer acceleration 188 | -------------------------------------------------------------------------------- /WinSlap.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2010 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinSlap", "WinSlap\WinSlap.csproj", "{63329533-A343-478C-B27D-05ED37648309}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Release|Any CPU = Release|Any CPU 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {63329533-A343-478C-B27D-05ED37648309}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {63329533-A343-478C-B27D-05ED37648309}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {63329533-A343-478C-B27D-05ED37648309}.Debug|x64.ActiveCfg = Debug|x64 19 | {63329533-A343-478C-B27D-05ED37648309}.Debug|x64.Build.0 = Debug|x64 20 | {63329533-A343-478C-B27D-05ED37648309}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {63329533-A343-478C-B27D-05ED37648309}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {63329533-A343-478C-B27D-05ED37648309}.Release|x64.ActiveCfg = Release|x64 23 | {63329533-A343-478C-B27D-05ED37648309}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {05204D06-5315-46EE-BDE6-CF67D0C61242} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /WinSlap/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /WinSlap/Coffee.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WinSlap 2 | { 3 | partial class Coffee 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.buttonYes = new System.Windows.Forms.Button(); 32 | this.buttonNo = new System.Windows.Forms.Button(); 33 | this.labelTitle = new System.Windows.Forms.Label(); 34 | this.pictureBox1 = new System.Windows.Forms.PictureBox(); 35 | this.label1 = new System.Windows.Forms.Label(); 36 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); 37 | this.SuspendLayout(); 38 | // 39 | // buttonYes 40 | // 41 | this.buttonYes.Location = new System.Drawing.Point(257, 114); 42 | this.buttonYes.Name = "buttonYes"; 43 | this.buttonYes.Size = new System.Drawing.Size(104, 23); 44 | this.buttonYes.TabIndex = 0; 45 | this.buttonYes.Text = "Sure!"; 46 | this.buttonYes.UseVisualStyleBackColor = true; 47 | this.buttonYes.Click += new System.EventHandler(this.buttonYes_Click); 48 | // 49 | // buttonNo 50 | // 51 | this.buttonNo.Location = new System.Drawing.Point(141, 114); 52 | this.buttonNo.Name = "buttonNo"; 53 | this.buttonNo.Size = new System.Drawing.Size(104, 23); 54 | this.buttonNo.TabIndex = 1; 55 | this.buttonNo.Text = "No thanks"; 56 | this.buttonNo.UseVisualStyleBackColor = true; 57 | this.buttonNo.Click += new System.EventHandler(this.buttonNo_Click); 58 | // 59 | // labelTitle 60 | // 61 | this.labelTitle.AutoSize = true; 62 | this.labelTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 63 | this.labelTitle.Location = new System.Drawing.Point(136, 12); 64 | this.labelTitle.Name = "labelTitle"; 65 | this.labelTitle.Size = new System.Drawing.Size(230, 25); 66 | this.labelTitle.TabIndex = 2; 67 | this.labelTitle.Text = "Saved you some time?"; 68 | // 69 | // pictureBox1 70 | // 71 | this.pictureBox1.Image = global::WinSlap.Properties.Resources.coffee_cup_svgrepo_com1; 72 | this.pictureBox1.Location = new System.Drawing.Point(12, 12); 73 | this.pictureBox1.Name = "pictureBox1"; 74 | this.pictureBox1.Size = new System.Drawing.Size(118, 132); 75 | this.pictureBox1.TabIndex = 3; 76 | this.pictureBox1.TabStop = false; 77 | // 78 | // label1 79 | // 80 | this.label1.AutoSize = true; 81 | this.label1.Location = new System.Drawing.Point(138, 54); 82 | this.label1.Name = "label1"; 83 | this.label1.Size = new System.Drawing.Size(247, 39); 84 | this.label1.TabIndex = 4; 85 | this.label1.Text = "Consider buying me a coffee on Ko-Fi.\r\n\r\nOpen ko-fi.com/svenmauch once after the " + 86 | "reboot?"; 87 | // 88 | // Coffee 89 | // 90 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 91 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 92 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(239)))), ((int)(((byte)(231)))), ((int)(((byte)(222))))); 93 | this.ClientSize = new System.Drawing.Size(393, 149); 94 | this.Controls.Add(this.label1); 95 | this.Controls.Add(this.pictureBox1); 96 | this.Controls.Add(this.labelTitle); 97 | this.Controls.Add(this.buttonNo); 98 | this.Controls.Add(this.buttonYes); 99 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; 100 | this.Name = "Coffee"; 101 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 102 | this.Text = "Coffee"; 103 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); 104 | this.ResumeLayout(false); 105 | this.PerformLayout(); 106 | 107 | } 108 | 109 | #endregion 110 | 111 | private System.Windows.Forms.Button buttonYes; 112 | private System.Windows.Forms.Button buttonNo; 113 | private System.Windows.Forms.Label labelTitle; 114 | private System.Windows.Forms.PictureBox pictureBox1; 115 | private System.Windows.Forms.Label label1; 116 | } 117 | } -------------------------------------------------------------------------------- /WinSlap/Coffee.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32; 2 | using System; 3 | using System.Diagnostics; 4 | using System.Windows.Forms; 5 | 6 | namespace WinSlap 7 | { 8 | public partial class Coffee : Form 9 | { 10 | public Coffee() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | private static void RestartNow() 16 | { 17 | ProcessStartInfo proc = new ProcessStartInfo 18 | { 19 | FileName = "cmd", 20 | WindowStyle = ProcessWindowStyle.Hidden, 21 | Arguments = "/C shutdown -f -r -t 0" 22 | }; 23 | Process.Start(proc); 24 | } 25 | 26 | private void buttonNo_Click(object sender, EventArgs e) 27 | { 28 | RestartNow(); 29 | } 30 | 31 | private void buttonYes_Click(object sender, EventArgs e) 32 | { 33 | string cmdLine = $"\"{Environment.GetFolderPath(Environment.SpecialFolder.System)}\\cmd.exe\" /C start https://ko-fi.com/svenmauch"; 34 | RegistryKey key = Registry.CurrentUser.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce"); 35 | key.SetValue("WinSlapOpenKoFi", cmdLine); 36 | key.Close(); 37 | RestartNow(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /WinSlap/Coffee.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /WinSlap/GlobalSuppressions.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/svenmauch/WinSlap/33dc9f185e9ea25a8bc3bfabade73494008b5973/WinSlap/GlobalSuppressions.cs -------------------------------------------------------------------------------- /WinSlap/Globals.cs: -------------------------------------------------------------------------------- 1 | namespace WinSlap 2 | { 3 | static class Globals 4 | { 5 | public static string winmajor; // 10, 11 6 | public static int winbuild; // 19043, 22000 7 | public static string winrelease; // 21H1, 21H2 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /WinSlap/HardwareInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Management; 3 | 4 | namespace WinSlap 5 | { 6 | public static class HardwareInfo 7 | { 8 | public static String GetProcessorId() 9 | { 10 | 11 | ManagementClass mc = new ManagementClass("win32_processor"); 12 | ManagementObjectCollection moc = mc.GetInstances(); 13 | String id = String.Empty; 14 | foreach (var o in moc) 15 | { 16 | var mo = (ManagementObject) o; 17 | 18 | id = mo.Properties["processorID"].Value.ToString(); 19 | break; 20 | } 21 | return id; 22 | 23 | } 24 | public static String GetHddSerialNo() 25 | { 26 | ManagementClass mangnmt = new ManagementClass("Win32_LogicalDisk"); 27 | ManagementObjectCollection mcol = mangnmt.GetInstances(); 28 | string result = ""; 29 | foreach (var o in mcol) 30 | { 31 | var strt = (ManagementObject) o; 32 | result += Convert.ToString(strt["VolumeSerialNumber"]); 33 | } 34 | return result; 35 | } 36 | public static string GetMacAddress() 37 | { 38 | ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration"); 39 | ManagementObjectCollection moc = mc.GetInstances(); 40 | string macAddress = String.Empty; 41 | foreach (var o in moc) 42 | { 43 | var mo = (ManagementObject) o; 44 | if (macAddress == String.Empty) 45 | { 46 | if ((bool)mo["IPEnabled"]) macAddress = mo["MacAddress"].ToString(); 47 | } 48 | mo.Dispose(); 49 | } 50 | 51 | macAddress = macAddress.Replace(":", ""); 52 | return macAddress; 53 | } 54 | public static string GetBoardMaker() 55 | { 56 | 57 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_BaseBoard"); 58 | foreach (var o in searcher.Get()) 59 | { 60 | var wmi = (ManagementObject) o; 61 | try 62 | { 63 | return wmi.GetPropertyValue("Manufacturer").ToString(); 64 | } 65 | 66 | catch { } 67 | } 68 | 69 | return "Board Maker: Unknown"; 70 | 71 | } 72 | public static string GetBoardModel() 73 | { 74 | 75 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_BaseBoard"); 76 | 77 | foreach (var o in searcher.Get()) 78 | { 79 | var wmi = (ManagementObject) o; 80 | try 81 | { 82 | return wmi.GetPropertyValue("Product").ToString(); 83 | 84 | } 85 | 86 | catch {} 87 | } 88 | 89 | return "Product: Unknown"; 90 | 91 | } 92 | public static string GetCdRomDrive() 93 | { 94 | 95 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_CDROMDrive"); 96 | 97 | foreach (ManagementObject wmi in searcher.Get()) 98 | { 99 | try 100 | { 101 | return wmi.GetPropertyValue("Drive").ToString(); 102 | 103 | } 104 | 105 | catch { } 106 | 107 | } 108 | 109 | return "CD ROM Drive Letter: Unknown"; 110 | 111 | } 112 | public static string GetBioSmaker() 113 | { 114 | 115 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_BIOS"); 116 | 117 | foreach (ManagementObject wmi in searcher.Get()) 118 | { 119 | try 120 | { 121 | return wmi.GetPropertyValue("Manufacturer").ToString(); 122 | 123 | } 124 | 125 | catch { } 126 | 127 | } 128 | 129 | return "BIOS Maker: Unknown"; 130 | 131 | } 132 | public static string GetBioSserNo() 133 | { 134 | 135 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_BIOS"); 136 | 137 | foreach (ManagementObject wmi in searcher.Get()) 138 | { 139 | try 140 | { 141 | return wmi.GetPropertyValue("SerialNumber").ToString(); 142 | 143 | } 144 | 145 | catch { } 146 | 147 | } 148 | 149 | return "BIOS Serial Number: Unknown"; 150 | 151 | } 152 | public static string GetBiosDate() 153 | { 154 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_BIOS"); 155 | foreach (ManagementObject wmi in searcher.Get()) 156 | { 157 | try 158 | { 159 | string date = wmi.GetPropertyValue("ReleaseDate").ToString(); 160 | DateTime dt = ManagementDateTimeConverter.ToDateTime(date); 161 | date = dt.ToString("dd.MM.yyyy"); 162 | return date; 163 | } 164 | catch { } 165 | } 166 | return "Fehler 001"; 167 | } 168 | public static string GetBiosVersion() 169 | { 170 | 171 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_BIOS"); 172 | 173 | foreach (ManagementObject wmi in searcher.Get()) 174 | { 175 | try 176 | { 177 | return wmi.GetPropertyValue("SMBIOSBIOSVERSION").ToString(); 178 | 179 | } 180 | catch { } 181 | } 182 | return "BIOS Caption: Unknown"; 183 | } 184 | public static string GetBioScaption() 185 | { 186 | 187 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_BIOS"); 188 | 189 | foreach (ManagementObject wmi in searcher.Get()) 190 | { 191 | try 192 | { 193 | return wmi.GetPropertyValue("Caption").ToString(); 194 | 195 | } 196 | catch { } 197 | } 198 | return "BIOS Caption: Unknown"; 199 | } 200 | public static string GetCpuModel() 201 | { 202 | 203 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_Processor"); 204 | 205 | foreach (ManagementObject wmi in searcher.Get()) 206 | { 207 | try 208 | { 209 | return wmi.GetPropertyValue("Name").ToString(); 210 | 211 | } 212 | catch { } 213 | } 214 | return "Fehler 001"; 215 | } 216 | public static string GetPcName() 217 | { 218 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_OperatingSystem"); 219 | foreach (ManagementObject wmi in searcher.Get()) 220 | { 221 | try 222 | { 223 | return wmi.GetPropertyValue("CSName").ToString(); 224 | } 225 | catch { } 226 | } 227 | return "Fehler 001"; 228 | } 229 | public static string GetOsName() 230 | { 231 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_OperatingSystem"); 232 | foreach (ManagementObject wmi in searcher.Get()) 233 | { 234 | try 235 | { 236 | return wmi.GetPropertyValue("Caption").ToString(); 237 | } 238 | catch { } 239 | } 240 | return "Fehler 001"; 241 | } 242 | public static string GetOsInfo() 243 | { 244 | //Get Operating system information. 245 | OperatingSystem os = Environment.OSVersion; 246 | //Get version information about the os. 247 | Version vs = os.Version; 248 | 249 | //Variable to hold our return value 250 | string operatingSystem = ""; 251 | 252 | if (os.Platform == PlatformID.Win32Windows) 253 | { 254 | //This is a pre-NT version of Windows 255 | switch (vs.Minor) 256 | { 257 | case 0: 258 | operatingSystem = "95"; 259 | break; 260 | case 10: 261 | if (vs.Revision.ToString() == "2222A") 262 | operatingSystem = "98SE"; 263 | else 264 | operatingSystem = "98"; 265 | break; 266 | case 90: 267 | operatingSystem = "Me"; 268 | break; 269 | default: 270 | break; 271 | } 272 | } 273 | else if (os.Platform == PlatformID.Win32NT) 274 | { 275 | switch (vs.Major) 276 | { 277 | case 3: 278 | operatingSystem = "NT 3.51"; 279 | break; 280 | case 4: 281 | operatingSystem = "NT 4.0"; 282 | break; 283 | case 5: 284 | if (vs.Minor == 0) 285 | operatingSystem = "2000"; 286 | else 287 | operatingSystem = "XP"; 288 | break; 289 | case 6: 290 | if (vs.Minor == 0) 291 | operatingSystem = "Vista"; 292 | if (vs.Minor == 1) 293 | operatingSystem = "7"; 294 | if (vs.Minor == 2) 295 | operatingSystem = "8"; 296 | if (vs.Minor == 3) 297 | operatingSystem = "8.1"; 298 | break; 299 | default: 300 | break; 301 | } 302 | } 303 | return operatingSystem; 304 | } 305 | public static string GetOsVersion() 306 | { 307 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_OperatingSystem"); 308 | foreach (ManagementObject wmi in searcher.Get()) 309 | { 310 | try 311 | { 312 | return wmi.GetPropertyValue("Version").ToString(); 313 | } 314 | catch { } 315 | } 316 | return "Fehler 001"; 317 | } 318 | public static string GetDomain() 319 | { 320 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_ComputerSystem"); 321 | foreach (ManagementObject wmi in searcher.Get()) 322 | { 323 | try 324 | { 325 | return wmi.GetPropertyValue("Domain").ToString(); 326 | } 327 | catch { } 328 | } 329 | return "Fehler 001"; 330 | } 331 | public static string GetPcModel() 332 | { 333 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_ComputerSystem"); 334 | foreach (ManagementObject wmi in searcher.Get()) 335 | { 336 | try 337 | { 338 | return wmi.GetPropertyValue("Model").ToString(); 339 | } 340 | catch { } 341 | } 342 | return "Fehler 001"; 343 | } 344 | public static string GetOsDirectory() 345 | { 346 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_OperatingSystem"); 347 | foreach (ManagementObject wmi in searcher.Get()) 348 | { 349 | try 350 | { 351 | return wmi.GetPropertyValue("WindowsDirectory").ToString(); 352 | } 353 | catch { } 354 | } 355 | return "Fehler 001"; 356 | } 357 | public static string GetGpuName() 358 | { 359 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_VideoController"); 360 | foreach (ManagementObject wmi in searcher.Get()) 361 | { 362 | try 363 | { 364 | return wmi.GetPropertyValue("Name").ToString(); 365 | } 366 | catch { } 367 | } 368 | return "Fehler 001"; 369 | } 370 | public static string GetGpuDriverVersion() 371 | { 372 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_VideoController"); 373 | foreach (ManagementObject wmi in searcher.Get()) 374 | { 375 | try 376 | { 377 | return wmi.GetPropertyValue("DriverVersion").ToString(); 378 | } 379 | catch { } 380 | } 381 | return "Fehler 001"; 382 | } 383 | public static string GetGpuDriverDate() 384 | { 385 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_VideoController"); 386 | foreach (ManagementObject wmi in searcher.Get()) 387 | { 388 | try 389 | { 390 | string date = wmi.GetPropertyValue("DriverDate").ToString(); 391 | DateTime dt = ManagementDateTimeConverter.ToDateTime(date); 392 | date = dt.ToString("dd.MM.yyyy"); 393 | return date; 394 | } 395 | catch { } 396 | } 397 | return "Fehler 001"; 398 | } 399 | public static string GetOsInstallDate() 400 | { 401 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_OperatingSystem"); 402 | foreach (ManagementObject wmi in searcher.Get()) 403 | { 404 | try 405 | { 406 | string date = wmi.GetPropertyValue("InstallDate").ToString(); 407 | DateTime dt = ManagementDateTimeConverter.ToDateTime(date); 408 | date = dt.ToString("dd.MM.yyyy HH:mm"); 409 | return date; 410 | } 411 | catch { } 412 | } 413 | return "Fehler 001"; 414 | } 415 | public static string GetOsBootTime() 416 | { 417 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_OperatingSystem"); 418 | foreach (ManagementObject wmi in searcher.Get()) 419 | { 420 | try 421 | { 422 | string date = wmi.GetPropertyValue("LastBootUpTime").ToString(); 423 | DateTime dt = ManagementDateTimeConverter.ToDateTime(date); 424 | date = dt.ToString("dd.MM.yyyy HH:mm"); 425 | return date; 426 | } 427 | catch { } 428 | } 429 | return "Fehler 001"; 430 | } 431 | public static string GetOsLocalTime() 432 | { 433 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_OperatingSystem"); 434 | foreach (ManagementObject wmi in searcher.Get()) 435 | { 436 | try 437 | { 438 | string date = wmi.GetPropertyValue("LocalDateTime").ToString(); 439 | DateTime dt = ManagementDateTimeConverter.ToDateTime(date); 440 | date = dt.ToString("dd.MM.yyyy HH:mm"); 441 | return date; 442 | } 443 | catch { } 444 | } 445 | return "Fehler 001"; 446 | } 447 | public static string GetAccountName() 448 | { 449 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_UserAccount"); 450 | foreach (ManagementObject wmi in searcher.Get()) 451 | { 452 | try 453 | { 454 | 455 | return wmi.GetPropertyValue("Name").ToString(); 456 | } 457 | catch { } 458 | } 459 | return "User Account Name: Unknown"; 460 | 461 | } 462 | public static string GetPhysicalMemory() 463 | { 464 | ManagementScope oMs = new ManagementScope(); 465 | ObjectQuery oQuery = new ObjectQuery("SELECT Capacity FROM Win32_PhysicalMemory"); 466 | ManagementObjectSearcher oSearcher = new ManagementObjectSearcher(oMs, oQuery); 467 | ManagementObjectCollection oCollection = oSearcher.Get(); 468 | 469 | long memSize = 0; 470 | long mCap = 0; 471 | 472 | // In case more than one Memory sticks are installed 473 | foreach (ManagementObject obj in oCollection) 474 | { 475 | mCap = Convert.ToInt64(obj["Capacity"]); 476 | memSize += mCap; 477 | } 478 | memSize = (memSize / 1024) / 1024; 479 | return memSize.ToString() + " MB"; 480 | } 481 | 482 | public static int GetPhysicalMemoryInt() 483 | { 484 | ManagementScope oMs = new ManagementScope(); 485 | ObjectQuery oQuery = new ObjectQuery("SELECT Capacity FROM Win32_PhysicalMemory"); 486 | ManagementObjectSearcher oSearcher = new ManagementObjectSearcher(oMs, oQuery); 487 | ManagementObjectCollection oCollection = oSearcher.Get(); 488 | 489 | long memSize = 0; 490 | long mCap = 0; 491 | 492 | // In case more than one Memory sticks are installed 493 | foreach (ManagementObject obj in oCollection) 494 | { 495 | mCap = Convert.ToInt64(obj["Capacity"]); 496 | memSize += mCap; 497 | } 498 | memSize = (memSize / 1024) / 1024; 499 | return (int)memSize; 500 | } 501 | 502 | public static string GetNoRamSlots() 503 | { 504 | int memSlots = 0; 505 | ManagementScope oMs = new ManagementScope(); 506 | ObjectQuery oQuery2 = new ObjectQuery("SELECT MemoryDevices FROM Win32_PhysicalMemoryArray"); 507 | ManagementObjectSearcher oSearcher2 = new ManagementObjectSearcher(oMs, oQuery2); 508 | ManagementObjectCollection oCollection2 = oSearcher2.Get(); 509 | foreach (ManagementObject obj in oCollection2) 510 | { 511 | memSlots = Convert.ToInt32(obj["MemoryDevices"]); 512 | 513 | } 514 | return memSlots.ToString(); 515 | } 516 | public static string GetCpuManufacturer() 517 | { 518 | string cpuMan = String.Empty; 519 | //create an instance of the Managemnet class with the 520 | //Win32_Processor class 521 | ManagementClass mgmt = new ManagementClass("Win32_Processor"); 522 | //create a ManagementObjectCollection to loop through 523 | ManagementObjectCollection objCol = mgmt.GetInstances(); 524 | //start our loop for all processors found 525 | foreach (ManagementObject obj in objCol) 526 | { 527 | if (cpuMan == String.Empty) 528 | { 529 | // only return manufacturer from first CPU 530 | cpuMan = obj.Properties["Manufacturer"].Value.ToString(); 531 | } 532 | } 533 | return cpuMan; 534 | } 535 | public static int GetCpuCurrentClockSpeed() 536 | { 537 | int cpuClockSpeed = 0; 538 | //create an instance of the Managemnet class with the 539 | //Win32_Processor class 540 | ManagementClass mgmt = new ManagementClass("Win32_Processor"); 541 | //create a ManagementObjectCollection to loop through 542 | ManagementObjectCollection objCol = mgmt.GetInstances(); 543 | //start our loop for all processors found 544 | foreach (ManagementObject obj in objCol) 545 | { 546 | if (cpuClockSpeed == 0) 547 | { 548 | // only return cpuStatus from first CPU 549 | cpuClockSpeed = Convert.ToInt32(obj.Properties["CurrentClockSpeed"].Value.ToString()); 550 | } 551 | } 552 | //return the status 553 | return cpuClockSpeed; 554 | } 555 | public static string GetDefaultIpGateway() 556 | { 557 | //create out management class object using the 558 | //Win32_NetworkAdapterConfiguration class to get the attributes 559 | //of the network adapter 560 | ManagementClass mgmt = new ManagementClass("Win32_NetworkAdapterConfiguration"); 561 | //create our ManagementObjectCollection to get the attributes with 562 | ManagementObjectCollection objCol = mgmt.GetInstances(); 563 | string gateway = String.Empty; 564 | //loop through all the objects we find 565 | foreach (ManagementObject obj in objCol) 566 | { 567 | if (gateway == String.Empty) // only return MAC Address from first card 568 | { 569 | //grab the value from the first network adapter we find 570 | //you can change the string to an array and get all 571 | //network adapters found as well 572 | //check to see if the adapter's IPEnabled 573 | //equals true 574 | if ((bool)obj["IPEnabled"] == true) 575 | { 576 | gateway = obj["DefaultIPGateway"].ToString(); 577 | } 578 | } 579 | //dispose of our object 580 | obj.Dispose(); 581 | } 582 | //replace the ":" with an empty space, this could also 583 | //be removed if you wish 584 | gateway = gateway.Replace(":", ""); 585 | //return the mac address 586 | return gateway; 587 | } 588 | public static double? GetCpuSpeedInGHz() 589 | { 590 | double? gHz = null; 591 | using (ManagementClass mc = new ManagementClass("Win32_Processor")) 592 | { 593 | foreach (ManagementObject mo in mc.GetInstances()) 594 | { 595 | gHz = 0.001 * (UInt32)mo.Properties["CurrentClockSpeed"].Value; 596 | break; 597 | } 598 | } 599 | return gHz; 600 | } 601 | public static string GetCurrentLanguage() 602 | { 603 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_BIOS"); 604 | foreach (ManagementObject wmi in searcher.Get()) 605 | { 606 | try 607 | { 608 | return wmi.GetPropertyValue("CurrentLanguage").ToString(); 609 | 610 | } 611 | 612 | catch { } 613 | 614 | } 615 | return "BIOS Maker: Unknown"; 616 | } 617 | public static string GetOsInformation() 618 | { 619 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem"); 620 | foreach (ManagementObject wmi in searcher.Get()) 621 | { 622 | try 623 | { 624 | return ((string)wmi["Caption"]).Trim() + ", " + (string)wmi["Version"] + ", " + (string)wmi["OSArchitecture"]; 625 | } 626 | catch { } 627 | } 628 | return "BIOS Maker: Unknown"; 629 | } 630 | public static String GetProcessorInformation() 631 | { 632 | ManagementClass mc = new ManagementClass("win32_processor"); 633 | ManagementObjectCollection moc = mc.GetInstances(); 634 | String info = String.Empty; 635 | foreach (ManagementObject mo in moc) 636 | { 637 | string name = (string)mo["Name"]; 638 | name = name.Replace("(TM)", "™").Replace("(tm)", "™").Replace("(R)", "®").Replace("(r)", "®").Replace("(C)", "©").Replace("(c)", "©").Replace(" ", " ").Replace(" ", " "); 639 | 640 | info = name + ", " + (string)mo["Caption"] + ", " + (string)mo["SocketDesignation"]; 641 | //mo.Properties["Name"].Value.ToString(); 642 | //break; 643 | } 644 | return info; 645 | } 646 | public static String GetComputerName() 647 | { 648 | ManagementClass mc = new ManagementClass("Win32_ComputerSystem"); 649 | ManagementObjectCollection moc = mc.GetInstances(); 650 | String info = String.Empty; 651 | foreach (ManagementObject mo in moc) 652 | { 653 | info = (string)mo["Name"]; 654 | //mo.Properties["Name"].Value.ToString(); 655 | //break; 656 | } 657 | return info; 658 | } 659 | 660 | } 661 | } -------------------------------------------------------------------------------- /WinSlap/MainForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using System.Windows.Forms; 7 | 8 | namespace WinSlap 9 | { 10 | public sealed partial class MainForm : Form 11 | { 12 | private SlapForm SlapForm; 13 | 14 | public static readonly string Tmpfolder = Path.GetTempPath() + @"WinSlap\"; 15 | private bool _restart = true; 16 | 17 | public MainForm(string[] args) 18 | { 19 | const string strNoRestart = "norestart"; 20 | if (args.Any(strNoRestart.Contains)) { this._restart = false; } 21 | InitializeComponent(); 22 | MinimumSize = new System.Drawing.Size(332, 173); 23 | } 24 | 25 | private object[] GetSelectedItems(CheckedListBox tweaks, CheckedListBox appearance, CheckedListBox software, CheckedListBox advanced) 26 | { 27 | return tweaks.CheckedItems.OfType() 28 | .Concat(appearance.CheckedItems.OfType()) 29 | .Concat(software.CheckedItems.OfType()) 30 | .Concat(advanced.CheckedItems.OfType()) 31 | .ToArray(); 32 | } 33 | 34 | private int CountTotalCheckedItems(CheckedListBox tweaks, CheckedListBox appearance, CheckedListBox software, CheckedListBox advanced) 35 | { 36 | return tweaks.CheckedItems.Count 37 | + software.CheckedItems.Count 38 | + advanced.CheckedItems.Count 39 | + appearance.CheckedItems.Count; 40 | } 41 | 42 | // ToDo: implement cancel check 43 | private async Task DoWorkAsync(object[] items, int totalCheckedItems, IProgress progress) 44 | { 45 | int totalItemsDone = 0; 46 | 47 | try 48 | { 49 | for (int x = 0; x <= items.Length - 1; x++) 50 | { 51 | string boxcontent = items[x].ToString(); 52 | double progresspercent = (double)totalItemsDone / totalCheckedItems; 53 | int percent = (int)Math.Ceiling(progresspercent * 100); 54 | progress?.Report(new ProgressReport { PercentComplete = percent, CurrentJob = boxcontent }); 55 | await ApplySlapAsync(boxcontent); 56 | totalItemsDone++; 57 | } 58 | } 59 | catch (Exception ex) 60 | { 61 | string caption = "Something went wrong..."; 62 | string errorMessage = "Exception during slapping process.\n\n" + ex + "\n\nPlease report this issue on GitHub. Slapping will continue after closing this message."; 63 | MessageBox.Show(new Form { TopMost = true }, errorMessage, caption, MessageBoxButtons.OK, MessageBoxIcon.Error); 64 | } 65 | } 66 | 67 | public async void StartWork() 68 | { 69 | var progressIndicator = new Progress(report => 70 | { 71 | SlapForm.CurrentJobText = report.CurrentJob; 72 | SlapForm.PercentFinished = report.PercentComplete; 73 | }); 74 | object[] items; 75 | int totalCheckedItems; 76 | 77 | if (Globals.winmajor == "11") 78 | { 79 | items = GetSelectedItems(checkedListBoxWin11Tweaks, checkedListBoxWin11Appearance, checkedListBoxWin11Software, checkedListBoxWin11Advanced); 80 | totalCheckedItems = CountTotalCheckedItems(checkedListBoxWin11Tweaks, checkedListBoxWin11Software, checkedListBoxWin11Advanced, checkedListBoxWin11Appearance); 81 | } 82 | else 83 | { 84 | items = GetSelectedItems(checkedListBoxWin10TweaksSys, checkedListBoxWin10TweaksUser, checkedListBoxWin10Software, checkedListBoxWin10Advanced); 85 | totalCheckedItems = CountTotalCheckedItems(checkedListBoxWin10TweaksSys, checkedListBoxWin10TweaksUser, checkedListBoxWin10Software, checkedListBoxWin10Advanced); 86 | } 87 | 88 | await DoWorkAsync(items, totalCheckedItems, progressIndicator); 89 | 90 | if (_restart) 91 | { 92 | SlapForm.Dispose(); 93 | Coffee coffee = new Coffee(); 94 | coffee.Show(); 95 | } 96 | else 97 | { 98 | SlapForm.Dispose(); 99 | string caption = "Slapping finished!"; 100 | string errorMessage = "This message is shown because you are skipping the reboot.\n(shift-klick or norestart argument)"; 101 | MessageBox.Show(errorMessage, caption, MessageBoxButtons.OK, MessageBoxIcon.Information); 102 | Environment.Exit(0); 103 | } 104 | } 105 | 106 | private void ButtonSlap_Click(object sender, EventArgs e) 107 | { 108 | if (ModifierKeys == Keys.Shift) _restart = false; 109 | 110 | int totalCheckedItems; 111 | if (Globals.winmajor == "11") 112 | { 113 | totalCheckedItems = CountTotalCheckedItems(checkedListBoxWin11Tweaks, checkedListBoxWin11Software, checkedListBoxWin11Advanced, checkedListBoxWin11Appearance); 114 | } 115 | else 116 | { 117 | totalCheckedItems = CountTotalCheckedItems(checkedListBoxWin10TweaksSys, checkedListBoxWin10TweaksUser, checkedListBoxWin10Software, checkedListBoxWin10Advanced); 118 | } 119 | 120 | if (totalCheckedItems == 0) 121 | { 122 | string caption = "Notice"; 123 | string errorMessage = "No items selected."; 124 | MessageBox.Show(errorMessage, caption, MessageBoxButtons.OK, MessageBoxIcon.Warning); 125 | return; 126 | } 127 | 128 | if (!ShowDisclaimer()) return; 129 | 130 | Hide(); 131 | SlapForm = new SlapForm(); 132 | SlapForm.Show(); 133 | 134 | StartWork(); 135 | 136 | if (checkedListBoxWin10Software.CheckedItems.Count != 0 || checkedListBoxWin11Software.CheckedItems.Count != 0) 137 | { 138 | Process process1 = new Process(); 139 | ProcessStartInfo startInfo1 = new ProcessStartInfo(); 140 | startInfo1.WindowStyle = ProcessWindowStyle.Hidden; 141 | startInfo1.FileName = "cmd.exe"; 142 | startInfo1.Arguments = "/C where winget"; 143 | process1.StartInfo = startInfo1; 144 | process1.Start(); 145 | process1.WaitForExit(); 146 | if (process1.ExitCode != 0) 147 | { 148 | Slapper.InstallWinGet(); 149 | } 150 | 151 | Process process2 = new Process(); 152 | ProcessStartInfo startInfo2 = new ProcessStartInfo(); 153 | startInfo2.WindowStyle = ProcessWindowStyle.Hidden; 154 | startInfo2.FileName = "cmd.exe"; 155 | startInfo2.Arguments = "/C winget --version"; 156 | startInfo2.UseShellExecute = false; 157 | startInfo2.RedirectStandardOutput = true; 158 | process2.StartInfo = startInfo2; 159 | process2.Start(); 160 | string output2 = process2.StandardOutput.ReadToEnd(); 161 | process2.WaitForExit(); 162 | if (output2.Contains("v1.0") || output2.Contains("v1.1") || output2.Contains("v1.2")) 163 | { 164 | Slapper.InstallWinGet(); 165 | } 166 | } 167 | } 168 | 169 | private async Task ApplySlapAsync(string boxcontent) 170 | { 171 | try 172 | { 173 | switch (boxcontent) 174 | { 175 | case "Remove preinstalled apps except Photos, Calculator, Store": 176 | await Task.Run(() => Slapper.RemovePreinstalledApps()); 177 | break; 178 | case "Disable Shared Experiences": 179 | await Task.Run(() => Slapper.DisableSharedExperiences()); 180 | break; 181 | case "Disable Cortana": 182 | await Task.Run(() => Slapper.DisableCortana()); 183 | break; 184 | case "Disable Game DVR and Game Bar": 185 | await Task.Run(() => Slapper.DisableGameDvr()); 186 | break; 187 | case "Disable Hotspot 2.0": 188 | await Task.Run(() => Slapper.DisableHotspot20()); 189 | break; 190 | case "Don't include frequently used folders in Quick access": 191 | await Task.Run(() => Slapper.NoQuickAccess()); 192 | break; 193 | case "Don't show sync provider notifications": 194 | await Task.Run(() => Slapper.HideSyncNotifications()); 195 | break; 196 | case "Disable Sharing Wizard": 197 | await Task.Run(() => Slapper.DisableSharingWizard()); 198 | break; 199 | case "Show 'This PC' when launching File Explorer": 200 | await Task.Run(() => Slapper.LaunchThisPcFileExplorer()); 201 | break; 202 | case "Disable Telemetry": 203 | await Task.Run(() => Slapper.DisableTelemetry()); 204 | break; 205 | case "Uninstall OneDrive": 206 | await Task.Run(() => Slapper.UninstallOneDrive()); 207 | break; 208 | case "Disable Activity History": 209 | await Task.Run(() => Slapper.DisableActivityHistory()); 210 | break; 211 | case "Disable automatically installing Apps": 212 | await Task.Run(() => Slapper.DisableAutomaticAppInstall()); 213 | break; 214 | case "Disable Feedback dialogs": 215 | await Task.Run(() => Slapper.DisableFeedbackDialogs()); 216 | break; 217 | case "Disable Start Menu suggestions": 218 | await Task.Run(() => Slapper.DisableStartMenuSuggestions()); 219 | break; 220 | case "Disable Bing search": 221 | await Task.Run(() => Slapper.DisableBingSearch()); 222 | break; 223 | case "Disable password reveal button": 224 | await Task.Run(() => Slapper.DisablePasswordReveal()); 225 | break; 226 | case "Disable settings sync": 227 | await Task.Run(() => Slapper.DisableSettingsSync()); 228 | break; 229 | case "Disable startup sound": 230 | await Task.Run(() => Slapper.DisableStartupSound()); 231 | break; 232 | case "Disable autostart startup delay": 233 | await Task.Run(() => Slapper.DisableAutostartStartupDelay()); 234 | break; 235 | case "Disable location": 236 | await Task.Run(() => Slapper.DisableLocation()); 237 | break; 238 | case "Disable Advertising ID": 239 | await Task.Run(() => Slapper.DisableAdvertisingId()); 240 | break; 241 | case "Disable Malware Removal Tool data reporting": 242 | await Task.Run(() => Slapper.DisableMrtReporting()); 243 | break; 244 | case "Disable sending typing info to Microsoft": 245 | await Task.Run(() => Slapper.DisableSendingTypingInfo()); 246 | break; 247 | case "Disable Personalization": 248 | await Task.Run(() => Slapper.DisablePersonalization()); 249 | break; 250 | case "Hide language list from websites": 251 | await Task.Run(() => Slapper.HideLanguageListWebsites()); 252 | break; 253 | case "Disable Miracast": 254 | await Task.Run(() => Slapper.DisableMiracast()); 255 | break; 256 | case "Disable App Diagnostics": 257 | await Task.Run(() => Slapper.DisableAppDiagnostics()); 258 | break; 259 | case "Disable Wi-Fi Sense": 260 | await Task.Run(() => Slapper.DisableWiFiSense()); 261 | break; 262 | case "Disable lock screen Spotlight": 263 | await Task.Run(() => Slapper.DisableLockScreenSpotlight()); 264 | break; 265 | case "Disable automatic maps updates": 266 | await Task.Run(() => Slapper.DisableAutomaticMapsUpdates()); 267 | break; 268 | case "Disable error reporting": 269 | await Task.Run(() => Slapper.DisableErrorReporting()); 270 | break; 271 | case "Disable Remote Assistance": 272 | await Task.Run(() => Slapper.DisableRemoteAssistance()); 273 | break; 274 | case "Use UTC as BIOS time": 275 | await Task.Run(() => Slapper.UseUtcAsBiosTime()); 276 | break; 277 | case "Hide network from lock screen": 278 | await Task.Run(() => Slapper.HideNetworkFromLockScreen()); 279 | break; 280 | case "Disable sticky keys prompt": 281 | await Task.Run(() => Slapper.DisableStickyKeysPrompt()); 282 | break; 283 | case "Hide 3D Objects from File Explorer": 284 | await Task.Run(() => Slapper.Hide3DObjectsFileExplorer()); 285 | break; 286 | // todo: broken? 287 | /* 288 | case "Prevent preinstalling apps for new users": 289 | await Task.Run(() => Slapper.PreventPreinstallingApps()); 290 | break; 291 | */ 292 | case "Unpin preinstalled apps": 293 | await Task.Run(() => Slapper.UnpinPreinstalledApps()); 294 | break; 295 | case "Disable Smart Screen": 296 | await Task.Run(() => Slapper.DisableSmartScreen()); 297 | break; 298 | case "Disable Smart Glass": 299 | await Task.Run(() => Slapper.DisableSmartGlass()); 300 | break; 301 | case "Remove Intel Control Panel from context menus": 302 | await Task.Run(() => Slapper.RemoveIntelContextMenu()); 303 | break; 304 | case "Remove NVIDIA Control Panel from context menus": 305 | await Task.Run(() => Slapper.RemoveNvidiaContextMenu()); 306 | break; 307 | case "Remove AMD Control Panel from context menus": 308 | await Task.Run(() => Slapper.RemoveAmdContextMenu()); 309 | break; 310 | case "Disable suggested apps in Windows Ink Workspace": 311 | await Task.Run(() => Slapper.DisableInkAppSuggestions()); 312 | break; 313 | case "Disable experiments by Microsoft": 314 | await Task.Run(() => Slapper.DisableExperiments()); 315 | break; 316 | case "Disable Inventory Collection": 317 | await Task.Run(() => Slapper.DisableInventoryCollection()); 318 | break; 319 | case "Disable Steps Recorder": 320 | await Task.Run(() => Slapper.DisableStepsRecorder()); 321 | break; 322 | case "Disable Application Compatibility Engine": 323 | await Task.Run(() => Slapper.DisableCompatibilityAssistant()); 324 | break; 325 | case "Disable pre-release features and settings": 326 | await Task.Run(() => Slapper.DisablePreReleaseFeatures()); 327 | break; 328 | case "Disable camera on lock screen": 329 | await Task.Run(() => Slapper.DisableCameraLockScreen()); 330 | break; 331 | case "Disable Microsoft Edge first run page": 332 | await Task.Run(() => Slapper.DisableEdgeFirstRunPage()); 333 | break; 334 | case "Disable Microsoft Edge preload": 335 | await Task.Run(() => Slapper.DisableEdgePreload()); 336 | break; 337 | case "Install .NET Framework 2.0, 3.0 and 3.5": 338 | await Task.Run(() => Slapper.InstallNetFrameworks()); 339 | break; 340 | case "Update Windows Store apps": 341 | await Task.Run(() => Slapper.UpdateStoreApps()); 342 | break; 343 | case "Enable Windows Photo Viewer": 344 | await Task.Run(() => Slapper.EnablePhotoViewer()); 345 | break; 346 | case "Disable security questions for local accounts": 347 | await Task.Run(() => Slapper.DisableSecurityQuestions()); 348 | break; 349 | case "Disable app suggestions (e.g. use Edge instead of Firefox)": 350 | await Task.Run(() => Slapper.DisableAppSuggestions()); 351 | break; 352 | case "Remove default Fax printer": 353 | await Task.Run(() => Slapper.RemoveFaxPrinter()); 354 | break; 355 | case "Remove Microsoft XPS Document Writer": 356 | await Task.Run(() => Slapper.RemoveXPSDocumentWriter()); 357 | break; 358 | case "Disable clipboard history": 359 | await Task.Run(() => Slapper.DisableClipboardHistory()); 360 | break; 361 | case "Disable cloud sync of clipboard history": 362 | await Task.Run(() => Slapper.DisableClipboardCloudSync()); 363 | break; 364 | case "Disable automatic update of speech data": 365 | await Task.Run(() => Slapper.DisableAutomaticSpeechDataUpdates()); 366 | break; 367 | case "Disable handwriting error reports": 368 | await Task.Run(() => Slapper.DisableHandwritingErrorReports()); 369 | break; 370 | case "Disable cloud sync of text messages": 371 | await Task.Run(() => Slapper.DisableTextMessagesCloudSync()); 372 | break; 373 | case "Disable Bluetooth advertisements": 374 | await Task.Run(() => Slapper.DisableBluetoothAdvertisements()); 375 | break; 376 | case "Disable Windows Media DRM internet access": 377 | await Task.Run(() => Slapper.DisableDRMInternetAccess()); 378 | break; 379 | case "Disable Get even more out of Windows screen": 380 | await Task.Run(() => Slapper.DisableGetEvenMoreOutOfWindows()); 381 | break; 382 | case "Set power plan to high performance": 383 | await Task.Run(() => Slapper.SetPowerPlanHighPerformance()); 384 | break; 385 | case "Add This PC shortcut to desktop": 386 | await Task.Run(() => Slapper.AddThisPCShortcut()); 387 | break; 388 | case "Small taskbar icons": 389 | await Task.Run(() => Slapper.TaskbarSmallIcons()); 390 | break; 391 | case "Don't group tasks in taskbar": 392 | await Task.Run(() => Slapper.DoNotGroupTasks()); 393 | break; 394 | case "Hide Taskview button in taskbar": 395 | await Task.Run(() => Slapper.HideTaskview()); 396 | break; 397 | case "Hide People button in taskbar": 398 | await Task.Run(() => Slapper.DisablePeopleBand()); 399 | break; 400 | case "Hide search bar in taskbar": 401 | await Task.Run(() => Slapper.HideSearch()); 402 | break; 403 | case "Remove compatibility item from context menu": 404 | await Task.Run(() => Slapper.RemoveCompatibility()); 405 | break; 406 | case "Hide OneDrive Cloud states in File Explorer": 407 | await Task.Run(() => Slapper.DisableCloudStates()); 408 | break; 409 | case "Always show file name extensions": 410 | await Task.Run(() => Slapper.ShowFilenameExtensions()); 411 | break; 412 | case "Remove OneDrive from File Explorer": 413 | await Task.Run(() => Slapper.HideOneDriveFileExplorer()); 414 | break; 415 | case "Delete quicklaunch items": 416 | await Task.Run(() => Slapper.DeleteQuicklaunchItems()); 417 | break; 418 | case "Use Windows 7 volume control": 419 | await Task.Run(() => Slapper.UseWin7Volume()); 420 | break; 421 | case "Remove Microsoft Edge desktop shortcut": 422 | await Task.Run(() => Slapper.RemoveEdgeShortcut()); 423 | break; 424 | case "Disable Lockscreen Blur": 425 | await Task.Run(() => Slapper.DisableLockscreenBlur()); 426 | break; 427 | case "Hide Meet Now icon in taskbar": 428 | await Task.Run(() => Slapper.HideMeetNow()); 429 | break; 430 | case "Hide News and interests in taskbar": 431 | await Task.Run(() => Slapper.HideNewsAndInterests()); 432 | break; 433 | case "Disable notifications on the lock screen": 434 | await Task.Run(() => Slapper.DisableNotificationOnLockScreen()); 435 | break; 436 | case "Disable reminders and incoming VoIP calls on the lock screen": 437 | await Task.Run(() => Slapper.DisableRemindersAndCallsOnLockScreen()); 438 | break; 439 | case "Disable Windows welcome experience": 440 | await Task.Run(() => Slapper.DisableWelcomeExperience()); 441 | break; 442 | case "Disable Aero Shake": 443 | await Task.Run(() => Slapper.DisableAeroShake()); 444 | break; 445 | case "Disable suggestions in timeline": 446 | await Task.Run(() => Slapper.DisableTimelineSuggestions()); 447 | break; 448 | case "Disable typing insights": 449 | await Task.Run(() => Slapper.DisableTypingInsights()); 450 | break; 451 | case "Disable spell checker": 452 | await Task.Run(() => Slapper.DisableSpellChecker()); 453 | break; 454 | case "Disable text suggestions on the software keyboard": 455 | await Task.Run(() => Slapper.DisableTextSuggestions()); 456 | break; 457 | case "Disable SafeSearch": 458 | await Task.Run(() => Slapper.DisableSafeSearch()); 459 | break; 460 | case "Disable suggested content in settings app": 461 | await Task.Run(() => Slapper.DisableSuggestedContentInSettings()); 462 | break; 463 | case "Disable automatic login after finishing updates": 464 | await Task.Run(() => Slapper.DisableAutoLoginAfterUpdates()); 465 | break; 466 | case "Disable Windows Defender submitting sample files": 467 | await Task.Run(() => Slapper.DisableDefenderSampleFiles()); 468 | break; 469 | case "Use Windows 10 ribbon bar in Windows Explorer": 470 | await Task.Run(() => Slapper.UseWin10RibbonExplorer()); 471 | break; 472 | case "Install 7Zip": 473 | await Task.Run(() => Slapper.Install7Zip()); 474 | break; 475 | case "Install Adobe Acrobat Reader DC": 476 | await Task.Run(() => Slapper.InstallAdobeReaderDC()); 477 | break; 478 | case "Install Audacity": 479 | await Task.Run(() => Slapper.InstallAudacity()); 480 | break; 481 | case "Install BalenaEtcher": 482 | await Task.Run(() => Slapper.InstallBalenaEtcher()); 483 | break; 484 | case "Install calibre": 485 | await Task.Run(() => Slapper.InstallCalibre()); 486 | break; 487 | case "Install CPU-Z": 488 | await Task.Run(() => Slapper.InstallCPUZ()); 489 | break; 490 | case "Install Discord": 491 | await Task.Run(() => Slapper.InstallDiscord()); 492 | break; 493 | case "Install DupeGuru": 494 | await Task.Run(() => Slapper.InstallDupeGuru()); 495 | break; 496 | case "Install EarTrumpet": 497 | await Task.Run(() => Slapper.InstallEarTrumpet()); 498 | break; 499 | case "Install Epic Games Launcher": 500 | await Task.Run(() => Slapper.InstallEpicGamesLauncher()); 501 | break; 502 | case "Install Everything Search": 503 | await Task.Run(() => Slapper.InstallEverythingSearch()); 504 | break; 505 | case "Install f.lux": 506 | await Task.Run(() => Slapper.InstallFlux()); 507 | break; 508 | case "Install GIMP": 509 | await Task.Run(() => Slapper.InstallGIMP()); 510 | break; 511 | case "Install GPU-Z": 512 | await Task.Run(() => Slapper.InstallGPUZ()); 513 | break; 514 | case "Install Git": 515 | await Task.Run(() => Slapper.InstallGit()); 516 | break; 517 | case "Install Google Chrome": 518 | await Task.Run(() => Slapper.InstallGoogleChrome()); 519 | break; 520 | case "Install Inkscape": 521 | await Task.Run(() => Slapper.InstallInkscape()); 522 | break; 523 | case "Install Irfanview": 524 | await Task.Run(() => Slapper.InstallIrfanview()); 525 | break; 526 | case "Install Java Runtime Environment": 527 | await Task.Run(() => Slapper.InstallJavaRE()); 528 | break; 529 | case "Install KeePassXC": 530 | await Task.Run(() => Slapper.InstallKeePassXC()); 531 | break; 532 | case "Install LibreOffice": 533 | await Task.Run(() => Slapper.InstallLibreOffice()); 534 | break; 535 | case "Install Minecraft": 536 | await Task.Run(() => Slapper.InstallMinecraft()); 537 | break; 538 | case "Install Mozilla Firefox": 539 | await Task.Run(() => Slapper.InstallFirefox()); 540 | break; 541 | case "Install Mozilla Thunderbird": 542 | await Task.Run(() => Slapper.InstallThunderbird()); 543 | break; 544 | case "Install Nextcloud Desktop": 545 | await Task.Run(() => Slapper.InstallNextcloudDesktop()); 546 | break; 547 | case "Install Notepad++": 548 | await Task.Run(() => Slapper.InstallNotepadPlusPlus()); 549 | break; 550 | case "Install OBS Studio": 551 | await Task.Run(() => Slapper.InstallOBSStudio()); 552 | break; 553 | case "Install OpenHashTab": 554 | await Task.Run(() => Slapper.InstallOpenHashTab()); 555 | break; 556 | case "Install OpenVPN Connect": 557 | await Task.Run(() => Slapper.InstallOpenVPNConnect()); 558 | break; 559 | case "Install PowerToys": 560 | await Task.Run(() => Slapper.InstallPowerToys()); 561 | break; 562 | case "Install PuTTY": 563 | await Task.Run(() => Slapper.InstallPuTTY()); 564 | break; 565 | case "Install Python 3.11": 566 | await Task.Run(() => Slapper.InstallPython311()); 567 | break; 568 | case "Install Skype": 569 | await Task.Run(() => Slapper.InstallSkype()); 570 | break; 571 | case "Install Slack": 572 | await Task.Run(() => Slapper.InstallSlack()); 573 | break; 574 | case "Install Speccy": 575 | await Task.Run(() => Slapper.InstallSpeccy()); 576 | break; 577 | case "Install Steam": 578 | await Task.Run(() => Slapper.InstallSteam()); 579 | break; 580 | case "Install TeamViewer": 581 | await Task.Run(() => Slapper.InstallTeamViewer()); 582 | break; 583 | case "Install TeamSpeak": 584 | await Task.Run(() => Slapper.InstallTeamSpeak()); 585 | break; 586 | case "Install Telegram": 587 | await Task.Run(() => Slapper.InstallTelegram()); 588 | break; 589 | case "Install Ubisoft Connect": 590 | await Task.Run(() => Slapper.InstallUbisoftConnect()); 591 | break; 592 | case "Install VirtualBox": 593 | await Task.Run(() => Slapper.InstallVirtualBox()); 594 | break; 595 | case "Install Visual Studio Code": 596 | await Task.Run(() => Slapper.InstallVSCode()); 597 | break; 598 | case "Install VLC media player": 599 | await Task.Run(() => Slapper.InstallVlc()); 600 | break; 601 | case "Install WinRAR": 602 | await Task.Run(() => Slapper.InstallWinRAR()); 603 | break; 604 | case "Install WinSCP": 605 | await Task.Run(() => Slapper.InstallWinSCP()); 606 | break; 607 | case "Install Windows Terminal": 608 | await Task.Run(() => Slapper.InstallWindowsTerminal()); 609 | break; 610 | case "Install Wireguard": 611 | await Task.Run(() => Slapper.InstallWireguard()); 612 | break; 613 | case "Install Wireshark": 614 | await Task.Run(() => Slapper.InstallWireshark()); 615 | break; 616 | case "Install Zoom": 617 | await Task.Run(() => Slapper.InstallZoom()); 618 | break; 619 | case "Disable Background Apps": 620 | await Task.Run(() => Slapper.DisableBackgroundApps()); 621 | break; 622 | case "Precision Trackpad: Disable keyboard block after clicking": 623 | await Task.Run(() => Slapper.DisableBlockPrecisionTrackpad()); 624 | break; 625 | case "Disable Windows Defender": 626 | await Task.Run(() => Slapper.DisableDefender()); 627 | break; 628 | case "Disable Link-local Multicast Name Resolution": 629 | await Task.Run(() => Slapper.DisableLLMNR()); 630 | break; 631 | case "Disable Smart Multi-Homed Name Resolution": 632 | await Task.Run(() => Slapper.DisableSmartNameResolution()); 633 | break; 634 | case "Disable Web Proxy Auto-Discovery": 635 | await Task.Run(() => Slapper.DisableWPAD()); 636 | break; 637 | case "Disable Teredo tunneling": 638 | await Task.Run(() => Slapper.DisableTeredo()); 639 | break; 640 | case "Disable Intra-Site Automatic Tunnel Addressing Protocol": 641 | await Task.Run(() => Slapper.DisableISATAP()); 642 | break; 643 | case "Enable Windows Subsystem for Linux": 644 | await Task.Run(() => Slapper.EnableWSL()); 645 | break; 646 | case "Uninstall Internet Explorer": 647 | await Task.Run(() => Slapper.UninstallInternetExplorer()); 648 | break; 649 | case "Enable Storage Sense": 650 | await Task.Run(() => Slapper.EnableStorageSense()); 651 | break; 652 | case "Disable fast startup": 653 | await Task.Run(() => Slapper.DisableFastStartup()); 654 | break; 655 | case "Disable mouse pointer acceleration": 656 | await Task.Run(() => Slapper.DisableMousePointerAcceleration()); 657 | break; 658 | default: 659 | string caption = "Something went wrong..."; 660 | string errorMessage = "Item not found (" + boxcontent + ")\n\nPlease report this issue on GitHub. Slapping will continue after closing this message."; 661 | MessageBox.Show(new Form { TopMost = true }, errorMessage, caption, MessageBoxButtons.OK, MessageBoxIcon.Error); 662 | break; 663 | } 664 | } 665 | 666 | catch (NullReferenceException ex) 667 | { 668 | string caption = "Something went wrong..."; 669 | string errorMessage = "NullReferenceException in \"" + boxcontent + "\"\n\n" + ex + "\n\nPlease report this issue on GitHub. Slapping will continue after closing this message."; 670 | MessageBox.Show(new Form { TopMost = true }, errorMessage, caption, MessageBoxButtons.OK, MessageBoxIcon.Error); 671 | } 672 | } 673 | 674 | private void WinSlap_Load(object sender, EventArgs e) 675 | { 676 | InitParameterNotice(); 677 | 678 | AppDomain.CurrentDomain.ProcessExit += OnProcessExit; 679 | Directory.CreateDirectory(Tmpfolder); 680 | 681 | labelOS.Text = $"Windows {Globals.winmajor} ({Globals.winrelease})"; 682 | 683 | if (Globals.winmajor == "11") 684 | { 685 | tabControlWin11.Visible = true; 686 | tabControlWin10.Visible = false; 687 | } else 688 | { 689 | tabControlWin11.Visible = false; 690 | tabControlWin10.Visible = true; 691 | } 692 | } 693 | 694 | private void OnProcessExit(object sender, EventArgs e) 695 | { 696 | Directory.Delete(Tmpfolder, true); 697 | } 698 | 699 | private void InitParameterNotice() 700 | { 701 | parameternotice.Text = ""; 702 | if (!_restart) 703 | { 704 | parameternotice.Visible = true; 705 | parameternotice.Text += " NoRestart"; 706 | } 707 | } 708 | 709 | private static bool ShowDisclaimer() 710 | { 711 | string caption = "Important"; 712 | string disclaimer = "- All changes are made at your own risk.\n" + 713 | "- There is no easy way to revert the changes.\n" + 714 | "- Your PC will restart immediately after the changes have been made.\n \n" + 715 | "Are you ready to slap?"; 716 | 717 | if (MessageBox.Show(disclaimer, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) 718 | { 719 | return true; 720 | } 721 | return false; 722 | } 723 | 724 | private void ButtonUncheckTweaks_Click(object sender, EventArgs e) 725 | { 726 | CheckAll(checkedListBoxWin11Tweaks, false); 727 | } 728 | 729 | private void ButtonCheckTweaks_Click(object sender, EventArgs e) 730 | { 731 | CheckAll(checkedListBoxWin11Tweaks, true); 732 | } 733 | 734 | private void ButtonCheckSoftware_Click(object sender, EventArgs e) 735 | { 736 | CheckAll(checkedListBoxWin11Software, true); 737 | } 738 | 739 | private void ButtonUncheckSoftware_Click(object sender, EventArgs e) 740 | { 741 | CheckAll(checkedListBoxWin11Software, false); 742 | } 743 | 744 | private void ButtonCheckAdvanced_Click(object sender, EventArgs e) 745 | { 746 | CheckAll(checkedListBoxWin11Advanced, true); 747 | } 748 | 749 | private void ButtonUncheckAdvanced_Click(object sender, EventArgs e) 750 | { 751 | CheckAll(checkedListBoxWin11Advanced, false); 752 | } 753 | 754 | private void CheckAll(CheckedListBox list, bool check) 755 | { 756 | for (int i = 0; i < list.Items.Count; i++) 757 | { 758 | list.SetItemChecked(i, check); 759 | } 760 | } 761 | 762 | private void ButtonCheckAppearance_Click(object sender, EventArgs e) 763 | { 764 | CheckAll(checkedListBoxWin11Appearance, true); 765 | } 766 | 767 | private void ButtonUncheckAppearance_Click(object sender, EventArgs e) 768 | { 769 | CheckAll(checkedListBoxWin11Appearance, false); 770 | } 771 | 772 | private void LinkGitHub_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 773 | { 774 | Process.Start("https://github.com/svenmauch/WinSlap"); 775 | } 776 | 777 | private void buttonWin10CheckTweaks_Click(object sender, EventArgs e) 778 | { 779 | CheckAll(checkedListBoxWin10TweaksSys, true); 780 | } 781 | 782 | private void buttonWin10UncheckTweaks_Click(object sender, EventArgs e) 783 | { 784 | CheckAll(checkedListBoxWin10TweaksSys, false); 785 | } 786 | 787 | private void buttonWin10CheckSoftware_Click(object sender, EventArgs e) 788 | { 789 | CheckAll(checkedListBoxWin10Software, true); 790 | } 791 | 792 | private void buttonWin10UncheckSoftware_Click(object sender, EventArgs e) 793 | { 794 | CheckAll(checkedListBoxWin10Software, false); 795 | } 796 | 797 | private void buttonWin10CheckAdvanced_Click(object sender, EventArgs e) 798 | { 799 | CheckAll(checkedListBoxWin10Advanced, true); 800 | } 801 | 802 | private void buttonWin10UncheckAdvanced_Click(object sender, EventArgs e) 803 | { 804 | CheckAll(checkedListBoxWin10Advanced, false); 805 | } 806 | } 807 | } 808 | -------------------------------------------------------------------------------- /WinSlap/MainForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /WinSlap/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32; 2 | using System; 3 | using System.Windows.Forms; 4 | 5 | namespace WinSlap 6 | { 7 | static class Program 8 | { 9 | /// 10 | /// The main entry point for the application. 11 | /// 12 | [STAThread] 13 | static void Main(string[] args) 14 | { 15 | Application.EnableVisualStyles(); 16 | Application.SetCompatibleTextRenderingDefault(false); 17 | //Get Operating system information. 18 | OperatingSystem os = Environment.OSVersion; 19 | //Get version information about the os. 20 | Version vs = os.Version; 21 | 22 | if (vs.Major != 10) 23 | { 24 | MessageBox.Show("WinSlap only supports Windows 10.", "Unsupported OS", MessageBoxButtons.OK, MessageBoxIcon.Stop); 25 | Application.Exit(); 26 | } 27 | 28 | Globals.winrelease = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "DisplayVersion", "").ToString(); 29 | Globals.winbuild = Int32.Parse(Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "CurrentBuild", "").ToString()); 30 | 31 | 32 | if (Globals.winbuild >= 22000) 33 | { 34 | Globals.winmajor = "11"; 35 | } 36 | else 37 | { 38 | Globals.winmajor = "10"; 39 | } 40 | 41 | if (Globals.winbuild != 19045) 42 | { 43 | MessageBox.Show($"WinSlap 1.8 is developed for Windows 10 (22H2).\nThis PC is running Windows {Globals.winmajor} ({Globals.winrelease}).\nPlease proceed with caution.", "Untested OS", MessageBoxButtons.OK, MessageBoxIcon.Information); 44 | } 45 | 46 | Application.Run(new MainForm(args)); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /WinSlap/ProgressReport.cs: -------------------------------------------------------------------------------- 1 | namespace WinSlap 2 | { 3 | public class ProgressReport 4 | { 5 | public int PercentComplete { get; set; } 6 | public string CurrentJob { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /WinSlap/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("WinSlap")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("WinSlap")] 12 | [assembly: AssemblyCopyright("Copyright © Sven Mauch 2023")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("63329533-a343-478c-b27d-05ed37648309")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.8.0.0")] 35 | [assembly: AssemblyFileVersion("1.8.0.0")] 36 | -------------------------------------------------------------------------------- /WinSlap/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WinSlap.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | public class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | public static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WinSlap.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | public static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | public static System.Drawing.Bitmap coffee_cup_svgrepo_com { 67 | get { 68 | object obj = ResourceManager.GetObject("coffee-cup-svgrepo-com", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | public static System.Drawing.Bitmap coffee_cup_svgrepo_com1 { 77 | get { 78 | object obj = ResourceManager.GetObject("coffee-cup-svgrepo-com1", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Byte[]. 85 | /// 86 | public static byte[] delapps { 87 | get { 88 | object obj = ResourceManager.GetObject("delapps", resourceCulture); 89 | return ((byte[])(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Byte[]. 95 | /// 96 | public static byte[] photoviewer { 97 | get { 98 | object obj = ResourceManager.GetObject("photoviewer", resourceCulture); 99 | return ((byte[])(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Byte[]. 105 | /// 106 | public static byte[] preventpreinstallingapps { 107 | get { 108 | object obj = ResourceManager.GetObject("preventpreinstallingapps", resourceCulture); 109 | return ((byte[])(obj)); 110 | } 111 | } 112 | 113 | /// 114 | /// Looks up a localized resource of type System.Byte[]. 115 | /// 116 | public static byte[] startlayout { 117 | get { 118 | object obj = ResourceManager.GetObject("startlayout", resourceCulture); 119 | return ((byte[])(obj)); 120 | } 121 | } 122 | 123 | /// 124 | /// Looks up a localized resource of type System.Byte[]. 125 | /// 126 | public static byte[] StartMenuLayout { 127 | get { 128 | object obj = ResourceManager.GetObject("StartMenuLayout", resourceCulture); 129 | return ((byte[])(obj)); 130 | } 131 | } 132 | 133 | /// 134 | /// Looks up a localized resource of type System.Byte[]. 135 | /// 136 | public static byte[] updateapps { 137 | get { 138 | object obj = ResourceManager.GetObject("updateapps", resourceCulture); 139 | return ((byte[])(obj)); 140 | } 141 | } 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /WinSlap/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\preventpreinstallingapps.ps1;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | ..\Resources\StartMenuLayout;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 126 | 127 | 128 | ..\Resources\photoviewer.ps1;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 129 | 130 | 131 | ..\Resources\delapps.ps1;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 132 | 133 | 134 | ..\Resources\startlayout;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 135 | 136 | 137 | ..\Resources\coffee-cup-svgrepo-com.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 138 | 139 | 140 | ..\Resources\updateapps.ps1;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 141 | 142 | 143 | ..\Resources\coffee-cup-svgrepo-com1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 144 | 145 | -------------------------------------------------------------------------------- /WinSlap/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WinSlap.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.3.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /WinSlap/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WinSlap/Resources/StartMenuLayout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /WinSlap/Resources/StartMenuLayout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /WinSlap/Resources/coffee-cup-svgrepo-com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/svenmauch/WinSlap/33dc9f185e9ea25a8bc3bfabade73494008b5973/WinSlap/Resources/coffee-cup-svgrepo-com.png -------------------------------------------------------------------------------- /WinSlap/Resources/coffee-cup-svgrepo-com1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/svenmauch/WinSlap/33dc9f185e9ea25a8bc3bfabade73494008b5973/WinSlap/Resources/coffee-cup-svgrepo-com1.png -------------------------------------------------------------------------------- /WinSlap/Resources/delapps.ps1: -------------------------------------------------------------------------------- 1 | Set-ExecutionPolicy Unrestricted 2 | Get-AppxPackage -AllUsers | where-object {$_.name -notlike "*Microsoft.WindowsStore*"} | where-object {$_.name -notlike "*Microsoft.WindowsCalculator*"} | where-object {$_.name -notlike "*Microsoft.Windows.Photos*"} | where-object {$_.name -notlike "*IntelGraphics*"} | where-object {$_.name -notlike "*NVIDIAControlPanel*"} | where-object {$_.name -notlike "*Microsoft.ScreenSketch*"} | where-object {$_.name -notlike "*Microsoft.Winget*"} | where-object {$_.name -notlike "*Microsoft.DesktopAppInstaller*"} | Remove-AppxPackage -------------------------------------------------------------------------------- /WinSlap/Resources/photoviewer.ps1: -------------------------------------------------------------------------------- 1 | Set-ExecutionPolicy Unrestricted 2 | # Add Photo Viewer to 'Open with...' 3 | If (!(Test-Path "HKCR:")) { 4 | New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null 5 | } 6 | New-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open\command" -Force | Out-Null 7 | New-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open\DropTarget" -Force | Out-Null 8 | Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open" -Name "MuiVerb" -Type String -Value "@photoviewer.dll,-3043" 9 | Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open\command" -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" 10 | Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open\DropTarget" -Name "Clsid" -Type String -Value "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" 11 | 12 | # Set Photo Viewer association for bmp, gif, jpg, png and tif 13 | If (!(Test-Path "HKCR:")) { 14 | New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null 15 | } 16 | ForEach ($type in @("Paint.Picture", "giffile", "jpegfile", "pngfile")) { 17 | New-Item -Path $("HKCR:\$type\shell\open") -Force | Out-Null 18 | New-Item -Path $("HKCR:\$type\shell\open\command") | Out-Null 19 | Set-ItemProperty -Path $("HKCR:\$type\shell\open") -Name "MuiVerb" -Type ExpandString -Value "@%ProgramFiles%\Windows Photo Viewer\photoviewer.dll,-3043" 20 | Set-ItemProperty -Path $("HKCR:\$type\shell\open\command") -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" 21 | } -------------------------------------------------------------------------------- /WinSlap/Resources/preventpreinstallingapps.ps1: -------------------------------------------------------------------------------- 1 | Write-Host "Uninstalling default Microsoft applications..." 2 | Set-ExecutionPolicy Unrestricted 3 | Get-AppxProvisionedPackage -online | where-object {$_.packagename -notlike "*Microsoft.WindowsStore*"} | where-object {$_.packagename -notlike "*Microsoft.WindowsCalculator*"} | where-object {$_.packagename -notlike "*Microsoft.Windows.Photos*"} |Remove-AppxProvisionedPackage -online -------------------------------------------------------------------------------- /WinSlap/Resources/startlayout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/svenmauch/WinSlap/33dc9f185e9ea25a8bc3bfabade73494008b5973/WinSlap/Resources/startlayout -------------------------------------------------------------------------------- /WinSlap/Resources/startlayout.reg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/svenmauch/WinSlap/33dc9f185e9ea25a8bc3bfabade73494008b5973/WinSlap/Resources/startlayout.reg -------------------------------------------------------------------------------- /WinSlap/Resources/updateapps.ps1: -------------------------------------------------------------------------------- 1 | Set-ExecutionPolicy Unrestricted 2 | Get-CimInstance -Namespace "Root\cimv2\mdm\dmmap" -ClassName "MDM_EnterpriseModernAppManagement_AppManagement01" | Invoke-CimMethod -MethodName UpdateScanMethod -------------------------------------------------------------------------------- /WinSlap/SlapForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WinSlap 2 | { 3 | partial class SlapForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.label1 = new System.Windows.Forms.Label(); 32 | this.label2 = new System.Windows.Forms.Label(); 33 | this.currentOp = new System.Windows.Forms.Label(); 34 | this.progressBar1 = new System.Windows.Forms.ProgressBar(); 35 | this.SuspendLayout(); 36 | // 37 | // label1 38 | // 39 | this.label1.AutoSize = true; 40 | this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 41 | this.label1.ForeColor = System.Drawing.Color.White; 42 | this.label1.Location = new System.Drawing.Point(59, 19); 43 | this.label1.Name = "label1"; 44 | this.label1.Size = new System.Drawing.Size(202, 39); 45 | this.label1.TabIndex = 0; 46 | this.label1.Text = "Please Wait"; 47 | // 48 | // label2 49 | // 50 | this.label2.AutoSize = true; 51 | this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 52 | this.label2.ForeColor = System.Drawing.Color.White; 53 | this.label2.Location = new System.Drawing.Point(91, 70); 54 | this.label2.Name = "label2"; 55 | this.label2.Size = new System.Drawing.Size(138, 13); 56 | this.label2.TabIndex = 1; 57 | this.label2.Text = "Slapping in progress :-)"; 58 | // 59 | // currentOp 60 | // 61 | this.currentOp.AutoSize = true; 62 | this.currentOp.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 63 | this.currentOp.ForeColor = System.Drawing.Color.PaleTurquoise; 64 | this.currentOp.Location = new System.Drawing.Point(11, 100); 65 | this.currentOp.Name = "currentOp"; 66 | this.currentOp.Size = new System.Drawing.Size(99, 13); 67 | this.currentOp.TabIndex = 2; 68 | this.currentOp.Text = "Current Operation..."; 69 | // 70 | // progressBar1 71 | // 72 | this.progressBar1.Location = new System.Drawing.Point(12, 120); 73 | this.progressBar1.Name = "progressBar1"; 74 | this.progressBar1.Size = new System.Drawing.Size(299, 23); 75 | this.progressBar1.TabIndex = 3; 76 | // 77 | // SlapForm 78 | // 79 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 80 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 81 | this.BackColor = System.Drawing.Color.Teal; 82 | this.ClientSize = new System.Drawing.Size(323, 154); 83 | this.ControlBox = false; 84 | this.Controls.Add(this.progressBar1); 85 | this.Controls.Add(this.currentOp); 86 | this.Controls.Add(this.label2); 87 | this.Controls.Add(this.label1); 88 | this.Cursor = System.Windows.Forms.Cursors.WaitCursor; 89 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; 90 | this.MaximizeBox = false; 91 | this.MinimizeBox = false; 92 | this.Name = "SlapForm"; 93 | this.ShowIcon = false; 94 | this.ShowInTaskbar = false; 95 | this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; 96 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 97 | this.Text = "Slapping"; 98 | this.TopMost = true; 99 | this.Load += new System.EventHandler(this.Slapping_Load); 100 | this.ResumeLayout(false); 101 | this.PerformLayout(); 102 | 103 | } 104 | 105 | #endregion 106 | 107 | private System.Windows.Forms.Label label1; 108 | private System.Windows.Forms.Label label2; 109 | private System.Windows.Forms.Label currentOp; 110 | private System.Windows.Forms.ProgressBar progressBar1; 111 | } 112 | } -------------------------------------------------------------------------------- /WinSlap/SlapForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace WinSlap 5 | { 6 | public partial class SlapForm : Form 7 | { 8 | public int PercentFinished 9 | { 10 | get => progressBar1.Value; 11 | set => progressBar1.Value = value; 12 | } 13 | 14 | public string CurrentJobText 15 | { 16 | get => currentOp.Text; 17 | set => currentOp.Text = value; 18 | } 19 | 20 | public SlapForm() 21 | { 22 | InitializeComponent(); 23 | } 24 | 25 | private void Slapping_Load(object sender, EventArgs e) 26 | { 27 | 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /WinSlap/SlapForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /WinSlap/WinAPI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace WinSlap 5 | { 6 | public class WinAPI 7 | { 8 | [DllImport("user32.dll")] 9 | public static extern IntPtr GetShellWindow(); 10 | 11 | [DllImport("user32.dll", SetLastError = true)] 12 | public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId); 13 | 14 | public static uint GetShellWindowProcessId() 15 | { 16 | var shellWindow = GetShellWindow(); 17 | GetWindowThreadProcessId(shellWindow, out var shellProcessId); 18 | return shellProcessId; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /WinSlap/WinSlap.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {63329533-A343-478C-B27D-05ED37648309} 8 | WinExe 9 | WinSlap 10 | WinSlap 11 | v4.8 12 | 512 13 | true 14 | false 15 | 16 | publish\ 17 | true 18 | Disk 19 | false 20 | Foreground 21 | 7 22 | Days 23 | false 24 | false 25 | true 26 | 0 27 | 1.6.0.0 28 | false 29 | true 30 | 31 | 32 | AnyCPU 33 | true 34 | full 35 | false 36 | bin\Debug\ 37 | DEBUG;TRACE 38 | prompt 39 | 4 40 | 41 | 42 | AnyCPU 43 | pdbonly 44 | true 45 | bin\Release\ 46 | TRACE 47 | prompt 48 | 4 49 | 50 | 51 | app.manifest 52 | 53 | 54 | true 55 | bin\x64\Debug\ 56 | DEBUG;TRACE 57 | full 58 | x64 59 | prompt 60 | AllRules.ruleset 61 | true 62 | false 63 | 64 | 65 | bin\x64\Release\ 66 | TRACE 67 | true 68 | pdbonly 69 | x64 70 | prompt 71 | MinimumRecommendedRules.ruleset 72 | true 73 | 74 | 75 | false 76 | 77 | 78 | 79 | 80 | 81 | 82 | false 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | ..\packages\System.Management.Automation.dll.10.0.10586.0\lib\net40\System.Management.Automation.dll 91 | True 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | Form 106 | 107 | 108 | Coffee.cs 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | Form 119 | 120 | 121 | SlapForm.cs 122 | 123 | 124 | Form 125 | 126 | 127 | MainForm.cs 128 | 129 | 130 | Coffee.cs 131 | 132 | 133 | PublicResXFileCodeGenerator 134 | Resources.Designer.cs 135 | Designer 136 | 137 | 138 | True 139 | Resources.resx 140 | True 141 | 142 | 143 | SlapForm.cs 144 | 145 | 146 | MainForm.cs 147 | 148 | 149 | Designer 150 | 151 | 152 | 153 | SettingsSingleFileGenerator 154 | Settings.Designer.cs 155 | 156 | 157 | True 158 | Settings.settings 159 | True 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | False 175 | Microsoft .NET Framework 4.6 %28x86 and x64%29 176 | true 177 | 178 | 179 | False 180 | .NET Framework 3.5 SP1 181 | false 182 | 183 | 184 | 185 | 186 | 187 | 188 | -------------------------------------------------------------------------------- /WinSlap/WinSlap.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | No -------------------------------------------------------------------------------- /WinSlap/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 52 | 59 | 60 | 61 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /WinSlap/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | --------------------------------------------------------------------------------